public ActionResult GetProducts()
 {
     return(this.Direct(new[]
     {
         ProductTestFixtures.GetProductDtoListWithThreeItems()
     }));
 }
        public ActionResult GetProduct(JObject id)
        {
            if (Guid.Parse(id.Value <string>("id")).CompareTo(Guid.Empty) == 0)
            {
                return(this.Direct(new { success = false }));
            }

            var product = ProductTestFixtures.GetDopamineDto();

            return(this.Direct(new { success = true, data = product }));
        }
Exemple #3
0
        public void ThatProductCanBeCreatedUsingFluentConstructor()
        {
            var product = Product.Create(ProductTestFixtures.GetProductDtoWithNoSubstances())
                          .Shape(ShapeTestFixtures.CreateIvFluidShape())
                          .Package(PackageTestFixtures.CreatePackageAmpul())
                          .Quantity(UnitTestFixtures.CreateUnitMililiter(), 5M)
                          .Substance(1, SubstanceTestFixtures.CreateSubstanceWithoutGroup(), 200,
                                     UnitTestFixtures.CreateUnitMilligram())
                          .Route(RouteTestFixtures.CreateRouteIv());

            Assert.IsInstanceOfType(product, typeof(Product));
        }
Exemple #4
0
        public void ThatProductCreateFailsWhenNoShape()
        {
            var           dto          = ProductTestFixtures.GetProductDtoWithNoSubstances();
            var           package      = PackageTestFixtures.CreatePackageAmpul();
            const decimal prodQuantity = 5M;
            var           unit         = UnitTestFixtures.CreateUnitMililiter();
            var           subst        = SubstanceTestFixtures.CreateSubstanceWithoutGroup();
            const int     order        = 1;
            const decimal quantity     = 200;
            var           substUnit    = UnitTestFixtures.CreateUnitMilligram();
            var           route        = RouteTestFixtures.CreateRouteIv();

            AssertCreateFails(quantity, subst, substUnit, route, order, null, dto, package, prodQuantity, unit);
        }
Exemple #5
0
        private static IProduct GetProduct()
        {
            var product = ProductServices.WithDto(ProductTestFixtures.GetProductDtoWithTwoSubstancesAndRoute()).Get();

            return(product);
        }