Skip to content

Commit 18535b6

Browse files
author
Pavel Okhlopkov
committedFeb 5, 2025·
add context testing in functions wo args
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
1 parent 8cddffc commit 18535b6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎tests/context_accepter_mock_test.go

+10
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ func TestContextAccepterMock_WhenThenMatchAnycontext(t *testing.T) {
4848
assert.Equal(t, 42, result)
4949
}
5050

51+
func TestContextAccepterMock_WhenThenMatchAnycontextWithoutArgs(t *testing.T) {
52+
tester := NewTesterMock(t)
53+
tester.CleanupMock.Return().HelperMock.Return()
54+
55+
mock := NewContextAccepterMock(tester).
56+
AcceptContextMock.When(minimock.AnyContext).Then()
57+
58+
mock.AcceptContext(context.TODO())
59+
}
60+
5161
func TestContextAccepterMock_DiffWithoutAnyContext(t *testing.T) {
5262
tester := NewTesterMock(t)
5363
tester.CleanupMock.Return().HelperMock.Return()

0 commit comments

Comments
 (0)
Please sign in to comment.