Skip to content

Commit

Permalink
reword tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arjun-1 committed Oct 24, 2024
1 parent 822223e commit 55bac84
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mock/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1516,34 +1516,34 @@ func Test_Mock_AssertExpectationsFunctionalOptionsType(t *testing.T) {

}

func Test_Mock_AssertExpectationsFunctionalOptionsType_Indirectly(t *testing.T) {
func Test_Mock_AssertExpectationsFunctionalOptionsType_Empty(t *testing.T) {

var mockedService = new(TestExampleImplementation)

mockedService.On("TheExampleMethodFunctionalOptions", "test", FunctionalOptions(OpNum(1), OpStr("foo"))).Return(nil).Once()
mockedService.On("TheExampleMethodFunctionalOptions", "test", FunctionalOptions()).Return(nil).Once()

tt := new(testing.T)
assert.False(t, mockedService.AssertExpectations(tt))

// make the call now
TheExampleMethodFunctionalOptionsIndirect(mockedService)
mockedService.TheExampleMethodFunctionalOptions("test")

// now assert expectations
assert.True(t, mockedService.AssertExpectations(tt))

}

func Test_Mock_AssertExpectationsFunctionalOptionsType_Empty(t *testing.T) {
func Test_Mock_AssertExpectationsFunctionalOptionsType_Indirectly(t *testing.T) {

var mockedService = new(TestExampleImplementation)

mockedService.On("TheExampleMethodFunctionalOptions", "test", FunctionalOptions()).Return(nil).Once()
mockedService.On("TheExampleMethodFunctionalOptions", "test", FunctionalOptions(OpNum(1), OpStr("foo"))).Return(nil).Once()

tt := new(testing.T)
assert.False(t, mockedService.AssertExpectations(tt))

// make the call now
mockedService.TheExampleMethodFunctionalOptions("test")
TheExampleMethodFunctionalOptionsIndirect(mockedService)

// now assert expectations
assert.True(t, mockedService.AssertExpectations(tt))
Expand Down

0 comments on commit 55bac84

Please sign in to comment.