Exemplo n.º 1
0
        public void GetSizeByID_Valid()
        {
            #region ASSIGN

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

            #endregion

            #region ACT

            var taskReturn = testController.GetSize(1);
            taskReturn.Wait();
            var result = taskReturn.Result.Value;

            Size testData = result;

            #endregion

            #region ASSERT

            Assert.AreEqual(testData.Id, 1);
            Assert.AreEqual(testData.BaseSize, "Small");
            Assert.AreEqual(testData.S_Price, 5.99M);

            #endregion
        }
Exemplo n.º 2
0
        public void GetSizeByID_NonExistingID()
        {
            #region ASSIGN

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

            #endregion

            #region ACT

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

            #endregion

            #region ASSERT

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

            #endregion
        }