 //
 
 import XCTest
+
 import JSQNotificationObserverKit
 
 


class JSQNotificationObserverKitTests: XCTestCase {

    func test_ThatNotificationIsPosted_AndReceivedByObserver_WithValueAndSender() {

        // GIVEN: a sender, value, notification, and observer
        let fakeSender = TestSender()
        let fakeValue = TestValue()
        let notification = Notification<TestValue, TestSender>(name: "\(__FUNCTION__)", sender: fakeSender)

        let expectation = self.expectationWithDescription("\(__FUNCTION__)")

        let observer = NotificationObserver(notification: notification) { (value, sender) -> Void in

            XCTAssertEqual(value.value, fakeValue.value, "Values should be equal")
            XCTAssertEqual(fakeSender.sender, sender!.sender, "Senders should be equal")

            expectation.fulfill()
        }


        // THEN: the observer does not receive the notification and does not execute its handler
        XCTAssertFalse(didCallHandler)
    }
    
}
