blob: 1576d6db09889b6a6dd13b6302b2c99694b35622 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)
})
})
}
|