test: add asset level service unit tests
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
2a0db41dbf
commit
edfa5f1449
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user