Guest User

Untitled

a guest
Dec 15th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. class Object {
  2. func startListeningForNotifications() {
  3. NotificationCenter.default.addObserver(self, selector: #selector(Object.notificationReceived), name: NSNotification.Name(rawValue: "ObjectNotification"), object: nil)
  4. }
  5. }
  6.  
  7. class ExampleTestCase: XCTestCase {
  8. func test_emulatateThrowingObjectNotification_then_getCurrentValue_returns_two() {
  9. object.startListeningForNotifications()
  10. emulateThrowingObjectNotification()
  11. XCTAssertEqual(object.getCurrentValue(), 2)
  12. }
  13. }
Add Comment
Please, Sign In to add comment