Пример #1
0
        public async Task MovementsContrAddBadReq()
        {
            using (var contex = new ProdContext(options))
            {
                var control = new MovementsController(contex);
                var result  = await control.Post(null);

                var badResult = result.Result as BadRequestResult;
                Assert.Equal(400, badResult.StatusCode);
            }
        }
Пример #2
0
        public async Task MovementsContrAdd()
        {
            using (var contex = new ProdContext(options))
            {
                var control             = new MovementsController(contex);
                ProductMovements newUom = new ProductMovements {
                    ProductId = 2, Quantity = -50
                };
                var result = await control.Post(newUom);

                var okResult = result.Result as OkObjectResult;
                Assert.Equal(newUom, okResult.Value);
                Assert.Equal(200, okResult.StatusCode);
            }
        }