public void Can_call_GetAsync_on_GetFactorial_using_RestClientAsync() { var asyncClient = CreateAsyncRestClient(); GetFactorialResponse response = null; asyncClient.GetAsync <GetFactorialResponse>("factorial/3", r => response = r, FailOnAsyncError); Thread.Sleep(1000); Assert.That(response, Is.Not.Null, "No response received"); Assert.That(response.Result, Is.EqualTo(GetFactorialService.GetFactorial(3))); }
public void Can_call_SendAsync_on_ServiceClient() { var jsonClient = new JsonServiceClient(ListeningOn); var request = new GetFactorial { ForNumber = 3 }; GetFactorialResponse response = null; jsonClient.SendAsync <GetFactorialResponse>(request, r => response = r, FailOnAsyncError); Thread.Sleep(1000); Assert.That(response, Is.Not.Null, "No response received"); Assert.That(response.Result, Is.EqualTo(GetFactorialService.GetFactorial(request.ForNumber))); }