From 0053db0d265af313dd281db5cf1e73236cde30c6 Mon Sep 17 00:00:00 2001 From: mo khan Date: Fri, 25 Apr 2025 11:00:53 -0600 Subject: refactor: move domain package into app --- app/domain/user_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 app/domain/user_test.go (limited to 'app/domain/user_test.go') 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) + }) + }) +} -- cgit v1.2.3