public void When_wrong_server_address_It_should_throw_a_web_exception_indicating_name_resolution_failure() { var fooClient = new PaynovaClient("http://fdac85aaeadd41ce91e7eacb402034b3.paynova.com", "fake", "fake"); Action a = () => fooClient.CreateOrder(TestState.CreateOrderRequest); a.ShouldThrow <WebException>() .And.Status.Should().Be(WebExceptionStatus.NameResolutionFailure); }
public void When_wrong_credentials_It_should_throw_a_web_exception_indicating_unauthorized() { var fooClient = new PaynovaClient(Client.Connection.ServerAddress, "fake", "fake"); Action a = () => fooClient.CreateOrder(TestState.CreateOrderRequest); a.ShouldThrow <WebException>() .And.Response.As <HttpWebResponse>() .StatusCode.Should() .Be(HttpStatusCode.Unauthorized); }