Skip to content

Commit d0cf67b

Browse files
committed
Added test on sending nil in models.
1 parent 28e8912 commit d0cf67b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

database/comment_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,20 @@ func TestMakeCommentsIgnoreFieldsWithEmptyComment(t *testing.T) {
262262
// Assert
263263
assert.Empty(t, err)
264264
}
265+
266+
func TestMakeCommentsIgnoreNilModel(t *testing.T) {
267+
mockCtrl, mockSC, ctx := initMocks(t)
268+
defer mockCtrl.Finish()
269+
270+
// Assert prepare
271+
mockSC.
272+
EXPECT().
273+
MakeColumnComment(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
274+
Times(0)
275+
276+
// Act
277+
err := MakeComments(ctx, mockSC, nil)
278+
279+
// Assert
280+
assert.Empty(t, err)
281+
}

0 commit comments

Comments
 (0)