diff --git a/pkg/generators/delegators_test.go b/pkg/generators/delegations_test.go similarity index 100% rename from pkg/generators/delegators_test.go rename to pkg/generators/delegations_test.go diff --git a/pkg/generators/unbonds_test.go b/pkg/generators/unbonds_test.go new file mode 100644 index 0000000..56856c8 --- /dev/null +++ b/pkg/generators/unbonds_test.go @@ -0,0 +1,36 @@ +package generators + +import ( + "main/pkg/constants" + "main/pkg/fetchers" + statePkg "main/pkg/state" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestUnbondsGeneratorNoState(t *testing.T) { + t.Parallel() + + state := statePkg.NewState() + generator := NewUnbondsGenerator() + results := generator.Generate(state) + assert.Empty(t, results) +} + +func TestUnbondsGeneratorNotEmptyState(t *testing.T) { + t.Parallel() + + state := statePkg.NewState() + state.Set(constants.FetcherNameUnbonds, fetchers.UnbondsData{ + Unbonds: map[string]map[string]uint64{ + "chain": { + "validator": 100, + }, + }, + }) + + generator := NewUnbondsGenerator() + results := generator.Generate(state) + assert.NotEmpty(t, results) +}