topfans/backend/services/assetService/service/asset_level_service_test.go
zerosaturation edfa5f1449 test: add asset level service unit tests
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 19:03:32 +08:00

29 lines
420 B
Go

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)
}
}
}