Exemple #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));
        }
Exemple #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);
        }
Exemple #3
0
        public void AValidShapeCanBeConstucted()
        {
            var shape = ShapeTestFixtures.CreateIvFluidShape();

            Assert.IsTrue(ShapeIsValid(shape));
        }