package domain import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestUser(t *testing.T) { t.Run("Sparkle", func(t *testing.T) { t.Run("returns a new Sparkle", func(t *testing.T) { tanuki := &User{Username: "tanuki"} user := &User{} sparkle := user.Sparkle(tanuki.Username, "for helping me with my homework") require.NotNil(t, sparkle) assert.Equal(t, tanuki.Username, sparkle.Sparklee) assert.Equal(t, "for helping me with my homework", sparkle.Reason) assert.Equal(t, user, sparkle.Author) }) }) }