コード例 #1
0
        public void ShouldReturnValidInventoryListWhenPostValidEatableItem()
        {
            var response       = _controller.Post(new Web.Models.EatableInput());
            var newEatabelItem = ((OkNegotiatedContentResult <Web.Models.Eatable>)response).Content;

            Assert.IsNotNull(newEatabelItem);
            Assert.AreEqual(newEatabelItem, _newEatable);
        }
コード例 #2
0
        public void Integration_ShouldDeleteEatableItem()
        {
            var postResponse          = _controller.Post(GenerateUniqEatable());
            var newEatable            = ((OkNegotiatedContentResult <Web.Models.Eatable>)postResponse).Content;
            var response              = _controller.Get();
            var beforeDeleteInventory = ((OkNegotiatedContentResult <IList <Web.Models.Eatable> >)response).Content.ToList();

            response = _controller.Delete(newEatable.Id);
            var afterDeleteInventory = ((OkNegotiatedContentResult <IList <Web.Models.Eatable> >)response).Content.ToList();

            Assert.IsNotNull(beforeDeleteInventory);
            Assert.IsNotNull(afterDeleteInventory);
            Assert.IsTrue(beforeDeleteInventory.Count == (afterDeleteInventory.Count + 1));
        }