/VerifyAfterRunning Secret
Created
December 23, 2015 04:59
Verify after running in OCMock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testVerifyAfterRunning_UsingClassMock { | |
//GIVEN | |
ClassA* object = [[ClassA alloc] init]; | |
id classMock = OCMClassMock([ClassB class]); | |
object->publicClass = classMock; | |
//WHEN /* run code under test */ | |
[object executeVoidMethodAndException:@"@congpc.ios"]; | |
//THEN | |
OCMVerify([classMock simulateException:@"@congpc.ios"]); | |
} | |
- (void)testVerifyAfterRunning_UsingStrictMock { | |
//GIVEN | |
ClassA* object = [[ClassA alloc] init]; | |
id classMock = OCMStrictClassMock([ClassB class]); | |
object->publicClass = classMock; | |
//WHEN /* run code under test */ | |
[object executeVoidMethodAndException:@"@congpc.ios"]; | |
//THEN | |
OCMVerify([classMock simulateException:@"@congpc.ios"]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment