Last active
January 25, 2021 09:53
-
-
Save yfujiki/dad9b0a06422593c2f25e61731e840a5 to your computer and use it in GitHub Desktop.
ViewModelTests for PhantomMockObject Project --- Fail
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
class ViewModelTests: XCTestCase { | |
var sut: ViewModel! | |
var logger: MockLoggerProtocol! | |
override func setUpWithError() throws { | |
} | |
override func tearDownWithError() throws { | |
} | |
func testAInit() { | |
// Given: | |
logger = MockLoggerProtocol() | |
// When: | |
sut = ViewModel(logger: logger) | |
// Then: | |
XCTAssertTrue(true, "Passed") | |
} | |
func testAppDidBecomeActive() { | |
// Given: | |
logger = MockLoggerProtocol() | |
sut = ViewModel(logger: logger) | |
Cuckoo.stub(logger) { stub in | |
when(stub.logAppIsActive()).thenDoNothing() | |
} | |
// When: | |
NotificationCenter.default.post(name: UIApplication.didBecomeActiveNotification, object: self) | |
// Then: | |
verify(logger, times(1)).logAppIsActive() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment