public void GetById_ReturnsNotFoundResult()
        {
            // Act
            var notFoundResult = _controller.Get(10010);

            // Assert
            Assert.IsType <NotFoundResult>(notFoundResult.Result);
        }
示例#2
0
        public async Task CreateWExistingItem_IIalreadyCreatedToday_OriginalIsIncemted()
        {
            try
            {
                //uut.CreateWNewItem(null, 1, ii, "Bearer " + jwt);
                var ii = new SimpleInventoryItem()
                {
                    Amount = 3,
                    ItemId = 2
                };
                var result = await uut.CreateWExistingItem(null, 3, ii, "Bearer " + jwt);

                result = await uut.CreateWExistingItem(null, 3, ii, "Bearer " + jwt);

                var result1 = await uut.Get(2, "Bearer " + jwt);

                Assert.That(result1.Value.Count, Is.EqualTo(2));//Two II already exists with seed data
                Assert.That(result1.Value[1].Amount, Is.EqualTo(10));
            }
            finally
            {
                dbc.Dispose();
            }
        }