Ejemplo n.º 1
0
        public async void Task_Delete_Return_BadRequestResult()
        {
            //Arrange
            var  controller = new InventoriesController(repository);
            long inventid   = 0;

            //Act
            var data = await controller.DeleteInventory(inventid);

            //Assert
            Assert.IsType <BadRequestResult>(data.Result);
        }
Ejemplo n.º 2
0
        public async void Task_Delete_Post_Return_OkResult()
        {
            //Arrange
            var controller = new InventoriesController(repository);
            var inventid   = 2;

            //Act
            var data = await controller.DeleteInventory(inventid);

            //Assert
            Assert.IsType <OkResult>(data.Result);
        }
        public void DeleteInventory_ShouldReturnOK()
        {
            var context = new TestInventory();
            var item    = GetInventoryItem();

            context.InventoryList.Add(item);

            var controller = new InventoriesController(context);
            var result     = controller.DeleteInventory(3) as OkNegotiatedContentResult <Inventory>;

            Assert.IsNotNull(result);
            Assert.AreEqual(item.ID, result.Content.ID);
        }