public void SetUp() { factory = Substitute.For<IRequestFactory>(); var client = Substitute.For<IRestClient>(); var request = Substitute.For<IRestRequest>(); var response = Substitute.For<IRestResponse>(); factory.CreateClient().Returns(client); factory.CreateRequest(null).ReturnsForAnyArgs(request); client.Execute(request).Returns(Task.FromResult(response)); response.StatusCode.Returns(HttpStatusCode.OK); descendant = new VkClientDescendant(factory, Substitute.For<IClientConfiguration>()); }
public void SetUp() { factory = Substitute.For <IRequestFactory>(); var client = Substitute.For <IRestClient>(); var request = Substitute.For <IRestRequest>(); var response = Substitute.For <IRestResponse>(); factory.CreateClient().Returns(client); factory.CreateRequest(null).ReturnsForAnyArgs(request); client.Execute(request).Returns(Task.FromResult(response)); response.StatusCode.Returns(HttpStatusCode.OK); descendant = new VkClientDescendant(factory, Substitute.For <IClientConfiguration>()); }
public void SetUp() { _restRequest = Substitute.For <IRestRequest>(); _restResponse = Substitute.For <IRestResponse>(); _restResponse.StatusCode.Returns(HttpStatusCode.OK); _restResponse.Content.Returns("response"); _restClient = Substitute.For <IRestClient>(); _restClient.ExecuteTaskAsync(_restRequest, CancellationToken.None).Returns(_restResponse); _factory = Substitute.For <IRequestFactory>(); _factory.CreateClient().Returns(_restClient); _factory.CreateRequest().Returns(_restRequest); _descendant = new VkClientDescendant(_factory, Substitute.For <IClientConfiguration>()); }
public void SetUp() { factory = Substitute.For<IRequestFactory>(); descendant = new VkClientDescendant(factory, Substitute.For<IClientConfiguration>()); }
public void SetUp() { factory = Substitute.For <IRequestFactory>(); factory.CreateClient().Execute(factory.CreateRequest()).StatusCode = HttpStatusCode.OK; descendant = new VkClientDescendant(factory, Substitute.For <IClientConfiguration>()); }
public void SetUp() { factory = Substitute.For <IRequestFactory>(); descendant = new VkClientDescendant(factory, Substitute.For <IClientConfiguration>()); }
public void SetUp() { factory = Substitute.For<IRequestFactory>(); factory.CreateClient().Execute(factory.CreateRequest()).StatusCode = HttpStatusCode.OK; descendant = new VkClientDescendant(factory, Substitute.For<IClientConfiguration>()); }