public void EndToEndTest() { const string buildUrl = "http://localhost:5000/"; byte[] expected; byte[] actual; var restClient = new HttpRestClient("https://www.google.com"); var routing = new RoutingRestClient { DefaultRestClient = restClient, RoutingAction = null }; using (var service = new Server(buildUrl, routing)) { var request = TestMother.BuildRequest(); var response = restClient.GetResponseAsync(request).Result; expected = response.Data; request = TestMother.BuildRequest(); request.Server = buildUrl; response = restClient.GetResponseAsync(request).Result; actual = response.Data; } Assert.IsNotNull(expected); Assert.IsTrue(expected.Length > 100); }
public void HttpRestClientRequest() { var sut = new HttpRestClient("https://www.google.com"); var request = TestMother.BuildRequest(); var response = sut.GetResponseAsync(request).Result; Assert.IsTrue(response.Data.Length > 0); }
public void RoutingRestClientRequest() { var sut = new RoutingRestClient { DefaultRestClient = new HttpRestClient("https://www.google.com") }; //sut.RoutingAction = p => sut.DefaultRestClient; var request = TestMother.BuildRequest(); var response = sut.GetResponseAsync(request).Result; Assert.IsTrue(response.Data.Length > 0); }