Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Object {
- …
- func startListeningForNotifications() {
- NotificationCenter.default.addObserver(self, selector: #selector(Object.notificationReceived), name: NSNotification.Name(rawValue: "ObjectNotification"), object: nil)
- }
- …
- }
- class ExampleTestCase: XCTestCase {
- …
- func test_emulatateThrowingObjectNotification_then_getCurrentValue_returns_two() {
- object.startListeningForNotifications()
- emulateThrowingObjectNotification()
- XCTAssertEqual(object.getCurrentValue(), 2)
- }
- …
- }
Add Comment
Please, Sign In to add comment