diff options
Diffstat (limited to 'app/domain/user_test.go')
| -rw-r--r-- | app/domain/user_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/domain/user_test.go b/app/domain/user_test.go new file mode 100644 index 0000000..1576d6d --- /dev/null +++ b/app/domain/user_test.go @@ -0,0 +1,24 @@ +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) + }) + }) +} |
