Ejemplo n.º 1
0
        public void GivenCustomerNonExistingId_WhenCustomerById_ThenReturnBadRequestWithCustomerNotFoundExceptionMessage()
        {
            //Given
            _customerServiceStub.GetCustomerById(-1).Returns(ex => { throw new CustomerNotFoundException(); });

            //When
            BadRequestObjectResult result = (BadRequestObjectResult)_customerController.GetCustomerBasedOnId(-1).Result;

            //Then
            Assert.Equal("Customer with this id does not exist", result.Value);
        }