Search Apps Documentation Source Content File Folder Download Copy Actions Download

foo1155_test.gno

0.75 Kb ยท 30 lines
 1package foo1155
 2
 3import (
 4	"testing"
 5
 6	"gno.land/p/demo/tokens/grc1155"
 7)
 8
 9func TestFoo721(t *testing.T) {
10	admin := address("g10x5phu0k6p64cwrhfpsc8tk43st9kug6wft530")
11	bob := address("g1ze6et22ces5atv79y4xh38s4kuraey4y2fr6tw")
12	tid1 := grc1155.TokenID("1")
13
14	for _, tc := range []struct {
15		name     string
16		expected any
17		fn       func() any
18	}{
19		{"BalanceOf(admin, tid1)", int64(100), func() any { return BalanceOf(admin, tid1) }},
20		{"BalanceOf(bob, tid1)", int64(0), func() any { return BalanceOf(bob, tid1) }},
21		{"IsApprovedForAll(admin, bob)", false, func() any { return IsApprovedForAll(admin, bob) }},
22	} {
23		t.Run(tc.name, func(t *testing.T) {
24			got := tc.fn()
25			if tc.expected != got {
26				t.Errorf("expected: %v got: %v", tc.expected, got)
27			}
28		})
29	}
30}