title: XCTest: Passing a function parameter
body: <p>From XCTest file, I am calling a web service call and had put a wait block using "self.waitForExpectationsWithTimeout" API and to get the service response. </p>
  
  <p>I have few test methods to be executed with this service response. When I store this response in a global variable and access it from other test function, this variable is coming as nil. What needs to be done here? Can I pass it as a function parameter?</p>
  
  <pre><code>let serviceResp :NSDictionary!
  
  func test_One() {
          //let expectation: XCTestExpectation = self.expectationWithDescription("HTTP")
  
          datamanager.fetchData() //Web service
  
          self.waitForExpectationsWithTimeout(5, handler: { (error: NSError!) -&gt; Void in
  
  //In 5 seconds, I will get response from service and will be stored in datamanager.response. 
  
      self.serviceResp = datamanager.response
          })
      }
  
  
      func test_Two() {
         //self.serviceResp is coming as nil even after assigning a value to it. 
      }
  </code></pre>
  
  <p>Thanks</p>