-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolumn_test.go
79 lines (58 loc) · 1.3 KB
/
column_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package morph_test
import (
"testing"
"github.com/freerware/morph"
"github.com/stretchr/testify/suite"
)
type ColumnTestSuite struct {
suite.Suite
sut morph.Column
}
func TestColumnTestSuite(t *testing.T) {
suite.Run(t, new(ColumnTestSuite))
}
func (s *ColumnTestSuite) SetupTest() {
s.sut = morph.Column{}
}
func (s *ColumnTestSuite) TestColumn_Name() {
// arrange.
expectedName := "username"
s.sut.SetName(expectedName)
// action.
actualName := s.sut.Name()
// assert.
s.Equal(expectedName, actualName)
}
func (s *ColumnTestSuite) TestColumn_SetName() {
// arrange.
expectedName := "username"
// action.
s.sut.SetName(expectedName)
// assert.
s.Equal(expectedName, s.sut.Name())
}
func (s *ColumnTestSuite) TestColumn_Field() {
// arrange.
expectedField := "Username"
s.sut.SetField(expectedField)
// action.
actualField := s.sut.Field()
// assert.
s.Equal(expectedField, actualField)
}
func (s *ColumnTestSuite) TestColumn_SetField() {
// arrange.
expectedField := "Username"
// action.
s.sut.SetField(expectedField)
// assert.
s.Equal(expectedField, s.sut.Field())
}
func (s *ColumnTestSuite) TestColumn_SetFieldType() {
// arrange.
expectedFieldType := "*string"
// action.
s.sut.SetFieldType(expectedFieldType)
// assert.
s.Equal(expectedFieldType, s.sut.FieldType())
}