Exemple #1
0
        public void AddProductToOrder_IdDoesNotExist_ReturnsNotFound()
        {
            var controller          = new OrdersController();
            var orderIdDoesNotExist = 0;
            var actualActionResult  = controller.CreateOrUpdateOrder("Margherita", orderIdDoesNotExist);

            Assert.IsInstanceOfType(actualActionResult, typeof(NotFoundResult));
        }
Exemple #2
0
        public void AddProductToOrder_ProductNames_ReturnsObjectResult(string productName, ObjectResult expectedObjectResult)
        {
            var controller = new OrdersController();

            var actual         = controller.CreateOrUpdateOrder(productName);
            var expectedResult = expectedObjectResult.GetType();

            Assert.IsInstanceOfType(actual, expectedResult);
        }