Ejemplo n.º 1
0
        public async Task IdOfNonexistentCustomer_AddCustomerOrder_ReturnNotFound()
        {
            const int customerId = -1;
            var       orderModel = new OrderRequestModel();

            var exception = await Assert.ThrowsAsync <ProblemDetailsException>(() =>
                                                                               _customerController.AddCustomerOrder(customerId, orderModel));

            Assert.Equal(StatusCodes.Status404NotFound, exception.Details.Status);
            Assert.Contains("customer", exception.Details.Title, StringComparison.OrdinalIgnoreCase);
        }