示例#1
0
        public void GetSpecialtyPizzaByID_InvalidID()
        {
            #region ASSIGN

            PizzaTypesRepo          testRepo       = new PizzaTypesRepo();
            PizzaTypesAPIController testController = new PizzaTypesAPIController(testRepo);

            #endregion

            #region ACT

            var taskReturn = testController.GetSpecialtyPizza(3);
            taskReturn.Wait();
            var result = taskReturn.Result.Value;

            SpecialtyPizza testData = result;

            #endregion

            #region ASSERT

            Assert.AreNotEqual(testData.ID, 1);
            Assert.AreNotEqual(testData.Name, "Special A");
            Assert.AreNotEqual(testData.Description, "TopA,TopB,TopC");
            Assert.AreNotEqual(testData.Price, 10.99M);

            #endregion
        }
示例#2
0
        public void GetSpecialtyPizzaByID_NonExistingID()
        {
            #region ASSIGN

            PizzaTypesRepo          testRepo       = new PizzaTypesRepo();
            PizzaTypesAPIController testController = new PizzaTypesAPIController(testRepo);

            #endregion

            #region ACT

            var taskReturn = testController.GetSpecialtyPizza(0);
            taskReturn.Wait();
            var result = taskReturn.Result.Result;

            #endregion

            #region ASSERT

            Assert.IsTrue(result is NotFoundResult);
            Assert.AreEqual((result as NotFoundResult).StatusCode, 404);

            #endregion
        }