public void TestRemoveItem()
        {
            // Given
            var item = new ItemModel
            {
                Id             = "idTest",
                Name           = "test",
                Type           = "test",
                ExpirationDate = new DateTime(2022, 6, 15, 13, 45, 30)
            };
            var mockItemRepository = new Mock <IItemRepository>();

            mockItemRepository.Setup(x => x.Remove(item.Id)).Returns(item);

            var mockNotificationRepository = new Mock <INotificationRepository>();
            var controller = new InventaryController(mockItemRepository.Object, mockNotificationRepository.Object);

            // When
            IActionResult result     = controller.RemoveItem(item.Id);
            var           deleteItem = result as OkObjectResult;

            //Then
            Assert.IsNotNull(deleteItem);
            Assert.AreEqual(deleteItem.Value, item.Id);
        }
        public void TestnotValidIdRemoveItem()
        {
            // Given
            var mockItemRepository         = new Mock <IItemRepository>();
            var mockNotificationRepository = new Mock <INotificationRepository>();
            var controller = new InventaryController(mockItemRepository.Object, mockNotificationRepository.Object);

            // When
            IActionResult result     = controller.RemoveItem(string.Empty);
            var           deleteItem = result as BadRequestObjectResult;

            //Then
            Assert.IsNotNull(deleteItem);
            Assert.AreEqual(deleteItem.StatusCode, 400);
            Assert.AreEqual(deleteItem.Value, "Para que elemento sea eliminado es necesario el id del mismo");
        }
        public void TestNotFoundRemoveItem()
        {
            // Given
            string    itemId = "idTest";
            ItemModel item   = null;

            var mockItemRepository = new Mock <IItemRepository>();

            mockItemRepository.Setup(x => x.Remove(itemId)).Returns(item);

            var mockNotificationRepository = new Mock <INotificationRepository>();
            var controller = new InventaryController(mockItemRepository.Object, mockNotificationRepository.Object);

            // When
            IActionResult result     = controller.RemoveItem(itemId);
            var           deleteItem = result as NotFoundObjectResult;

            //Then
            Assert.IsNotNull(deleteItem);
            Assert.AreEqual(deleteItem.StatusCode, 404);
            Assert.AreEqual(deleteItem.Value, "¡No se pudo eliminar!. El elemento no existe en el inventario");
        }