Ejemplo n.º 1
0
        public async void DeleteCustomerAddress_OK()
        {
            //Arrange
            var mockLogger             = new Mock <ILogger <CustomerApi> >();
            var mockHttpRequestFactory = new Mock <IHttpRequestFactory>();

            mockHttpRequestFactory.Setup(x => x.Post(It.IsAny <string>(), It.IsAny <object>(), It.IsAny <string>()))
            .ReturnsAsync(new HttpResponseMessage {
                StatusCode = HttpStatusCode.OK
            });
            var baseAddress = "BaseAddress";

            var sut = new CustomerApi(
                mockLogger.Object,
                mockHttpRequestFactory.Object,
                baseAddress
                );

            //Act
            await sut.DeleteCustomerAddressAsync(new DeleteCustomerAddressRequest
            {
                AccountNumber = "AW00000001",
                AddressType   = "Home"
            }
                                                 );

            //Assert
            mockHttpRequestFactory.Verify(x => x.Post(It.IsAny <string>(), It.IsAny <object>(), It.IsAny <string>()));
        }