title: Swift UnitTesting testing 2 optional variables
body: <p>I've 2 variables for which i want to be sure that both are not nil at same time, one variable must not nil to pass unit test.</p>
  
  <p>Following code can test for one object not be nil.</p>
  
  <blockquote>
    <p>I've 2 variables dataArray &amp; dataObject I just want to make sure that
    at a time one of them must have value</p>
  </blockquote>
  
  <pre><code>CoreWebService.sendRequest(requestURL: WebURL.testFeed, paramters: params) { (sender: RequestCallback&lt;BaseResponse&lt;DataJson&gt;&gt;) in
  
          switch sender {
          case .failed(let error):
              XCTFail("Error\(error.localizedDescription)")
              break
          case .success(let object):
              XCTAssertNotNil(object.dataArray, "data must not nil")
              break
          }
          xctExpect.fulfill()
  
      }
      waitForExpectations(timeout: timeout) { (error) in
          XCTAssertNil(error, "Test time out\(error?.localizedDescription)")
      }
  </code></pre>