Ejemplo n.º 1
0
        public async void DeleteCustomerContact_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.DeleteCustomerContactAsync(new DeleteCustomerContactRequest
            {
                AccountNumber = "AW00000001",
                ContactType   = "Order Administrator",
                Contact       = new TestBuilders.CustomerApi.DeleteCustomerContact.ContactBuilder().WithTestValues().Build()
            }
                                                 );

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