         XCTAssertNotNil(response.data)
         XCTAssertEqual(data, response.data)
     }
-}
-
-extension MockingTests {
+    
     func test_mockResponse_returnsErrorResultWhenRequestURLIsInvalid() {
         struct InvalidURLRequestEncodable: URLRequestEncodable {
             var urlRequestValue: NSURLRequest {


import XCTest
import ELWebService

class MockingTests: XCTestCase {
    func test_mockDataTask_changesStateWhenSuspended() {

    }
}

// MARK: - Mock Session

extension MockingTests {
    func test_mockSession_matchesStubWhenMatcherReturnsTrue() {
        struct StubRequest: URLRequestEncodable {
            var urlRequestValue: NSURLRequest {
                return NSURLRequest(URL: NSURL(string: "")!)
            }
        }
        
        let session = MockSession()
        let response = MockResponse(statusCode: 200)
        session.addStub(response) { _ in return true }
        
        let (_, urlResponse, error) = session.stubbedResponse(request: StubRequest())
        
        let httpResponse = urlResponse as? NSHTTPURLResponse
        
        XCTAssertNotNil(httpResponse)
        XCTAssertEqual(httpResponse!.statusCode, 200)
        XCTAssertNil(error)
    }
    
    func test_mockSession_failsToMatchStubWhenMatcherReturnsFalse() {
        struct StubRequest: URLRequestEncodable {
            var urlRequestValue: NSURLRequest {
                return NSURLRequest(URL: NSURL(string: "")!)
            }
        }
        
        let session = MockSession()
        let response = MockResponse(statusCode: 200)
        session.addStub(response) { _ in return false }
        
        let (data, urlResponse, error) = session.stubbedResponse(request: StubRequest())

        XCTAssertNil(data)
        XCTAssertNil(urlResponse)
        XCTAssertNil(error)
    }
}

// MARK: - Mock Response

extension MockingTests {
    func test_mockResponse_initializationWithData() {
        let data = NSData()
