     }
 }
 
+// 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()

        XCTAssertNotNil(error)
    }
}

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