Ejemplo n.º 1
0
        public void AddConversionQuantity_whenCalled_retrunsBadRequest()
        {
            try
            {
                var controller = new QuantityController(_quantityBL);

                var result = new QuantityAttributes()
                {
                    Value     = 5,
                    Operation = " "
                };

                //act
                var badresponse = controller.AddQuantityConversion(result);

                //assert
                Assert.IsType <BadRequestObjectResult>(badresponse);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
        }
Ejemplo n.º 2
0
        public void AddConversionQuantity_whenCalled_retrunsOkResult()
        {
            try
            {
                var controller = new QuantityController(_quantityBL);

                var result = new QuantityAttributes
                {
                    Value     = 1,
                    Operation = "YardToInch"
                };

                //act
                var okResult = controller.AddQuantityConversion(result);

                //assert
                Assert.IsType <OkObjectResult>(okResult);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
        }