title: Linking error in unit test using URLRequestConvertible
body: <p>I have a weird problem writing a simple unit test (Xcode 7.2) for a very simple function which makes sure a parameter is added to a URL:</p>
  
  <pre><code>func appendToken(token: String, toRequest request: URLRequestConvertible) throws -&gt; URLRequestConvertible {
      var error: NSError?
      let modifiedRequest: NSMutableURLRequest
      (modifiedRequest, error) = Alamofire.ParameterEncoding.URL.encode(request, parameters: ["token": self.token])
  
      guard error == nil else {
          // TODO: handle error
          throw error!
      }
  
      return modifiedRequest
  }
  </code></pre>
  
  <p>The unit test is like this:</p>
  
  <pre><code>func testTokenAddition() {
      let token = "ABCD12345"
      let client = MyClass(token: token)
      let originalRequest = NSURLRequest(URL: NSURL(string:"http://localhost")!)
  
      do {
          let modifiedRequest = try client.appendToken(token, toRequest: originalRequest).URLRequest
          XCTAssertTrue(modifiedRequest.URLRequest.URLString.hasSuffix("token=\(token)"))
      } catch {
          XCTFail()
          print(error)
      }
  }
  </code></pre>
  
  <p>Obviously this is a very simple test on which I want to build upon (so please don't focus on the actual assertion). But when I try to run the test, I get this linking error:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "protocol witness table for __ObjC.NSURLRequest : Alamofire.URLRequestConvertible in Alamofire", referenced from:
    SDKitTests.SDKitTests.testTokenAddition (SDKitTests.SDKitTests)() -&gt; () in SDKitTests.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>The function works when I run it from a normal target, so the problem is in the test function, but I'm not clear on how I should be calling it, I run the same code in a non-test class and there was no problem, so I'm a bit puzzled by this. Also the error message is a bit cryptic, from what I've Googled, a witness table is kind of like a vtable for protocols. But I haven't messed with that, the extension to <code>NSMutableURLRequest</code> is implemented in Alamofire, and I'm just using it.</p>
  
  <p>What am I doing wrong? What do I need to do to fix it?</p>