Exemplo n.º 1
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));
        }
Exemplo n.º 2
0
        public void ThatProductCreateFailsWhenProductHasNoRoute()
        {
            var           dto          = ProductTestFixtures.GetProductDtoWithNoSubstances();
            var           shape        = ShapeTestFixtures.CreateIvFluidShape();
            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();

            AssertCreateFails(quantity, subst, substUnit, null, order, shape, dto, package, prodQuantity, unit);
        }
Exemplo n.º 3
0
        public void AValidShapeCanBeConstucted()
        {
            var shape = ShapeTestFixtures.CreateIvFluidShape();

            Assert.IsTrue(ShapeIsValid(shape));
        }