public async Task GetById_HttpStatusCodeUnauthorizedTestAsync()
        {
            var id         = 1;
            var customerId = CustomerViewModelMock.GetCustomerId(id);

            var response = await _httpClient.GetAsync($"/api/v1/customers/{customerId}");

            Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
        }
        public async Task Delete_NotFoundTestAsync()
        {
            var id         = 1;
            var customerId = CustomerViewModelMock.GetCustomerId(id);
            var customer   = CustomerViewModelMock.GetCustomer();

            var customerController = new CustomerController(_customerServiceMock.Object);
            var customerService    = await customerController.Delete(customerId);

            var actionResult = Assert.IsType <NotFoundResult>(customerService);

            Assert.Equal(StatusCodes.Status404NotFound, actionResult.StatusCode);
        }
        public async Task GetById_SucessTestAsync()
        {
            var id         = 1;
            var customerId = CustomerViewModelMock.GetCustomerId(id);

            _customerServiceMock.Setup(x => x.GetAddressByIdAsync(customerId))
            .ReturnsAsync(CustomerViewModelMock.GetCustomerAddress());

            var customerController = new CustomerController(_customerServiceMock.Object);
            var customerService    = await customerController.Get(customerId);

            var actionResult = Assert.IsType <OkObjectResult>(customerService.Result);
            var actionValue  = Assert.IsType <CustomerAddressViewModel>(actionResult.Value);

            Assert.NotNull(actionResult);
            Assert.Equal(StatusCodes.Status200OK, actionResult.StatusCode);
        }
        public async Task Delete_SucessTestAsync()
        {
            var id         = 1;
            var customerId = CustomerViewModelMock.GetCustomerId(id);
            var customer   = CustomerViewModelMock.GetCustomer();

            _customerServiceMock.Setup(x => x.GetByIdAsync(customerId))
            .ReturnsAsync(customer);

            _customerServiceMock.Setup(x => x.Remove(customer));

            var customerController = new CustomerController(_customerServiceMock.Object);
            var customerService    = await customerController.Delete(customerId);

            var actionResult = Assert.IsType <NoContentResult>(customerService);

            Assert.Equal(StatusCodes.Status204NoContent, actionResult.StatusCode);
        }
        public async Task GetAddressByIdAsync_ReturnCustomerAddressViewModelTestAsync()
        {
            int id         = 1;
            var customerId = CustomerViewModelMock.GetCustomerId(id);

            _customerRepositoryMock.Setup(x => x.GetAddressByIdAsync(id))
            .ReturnsAsync(CustomerMock.GetCustomerAddress());

            _mapperMock.Setup(x => x.Map <CustomerAddressViewModel>(It.IsAny <CustomerAddress>()))
            .Returns(CustomerViewModelMock.GetCustomerAddress());

            var customerService = new CustomerService(_customerRepositoryMock.Object,
                                                      _viaCEPServiceMock.Object, _domainNotificationMock.Object,
                                                      _unitOfWorkMock.Object, _mapperMock.Object);

            var customeMethod = await customerService.GetAddressByIdAsync(customerId);

            var customerResult = Assert.IsAssignableFrom <CustomerAddressViewModel>(customeMethod);

            Assert.NotNull(customerResult);
        }