diff --git a/backend/services/assetService/service/asset_level_service_test.go b/backend/services/assetService/service/asset_level_service_test.go new file mode 100644 index 0000000..453463f --- /dev/null +++ b/backend/services/assetService/service/asset_level_service_test.go @@ -0,0 +1,28 @@ +package service + +import ( + "testing" +) + +func TestCalculateBuff(t *testing.T) { + tests := []struct { + likeCount int + expected int + }{ + {0, 0}, + {4, 0}, + {5, 10}, + {9, 10}, + {10, 20}, + {29, 20}, + {30, 30}, + {100, 30}, + } + + for _, tt := range tests { + result := CalculateBuff(tt.likeCount) + if result != tt.expected { + t.Errorf("CalculateBuff(%d) = %d, want %d", tt.likeCount, result, tt.expected) + } + } +}