Exemplo n.º 1
0
        private static Substance CreateSubstanceWithGroup()
        {
            var group = SubstanceGroup.Create(new SubstanceGroupDto {
                Name = "analgetica"
            });
            var subst = Substance.Create(SubstanceTestFixtures.GetSubstanceWithGroup());

            group.AddSubstance(subst);
            return(subst);
        }
Exemplo n.º 2
0
        public void ThrowAnErrorWhenSubsanceGroupNameIsEmptyString()
        {
            var subst = Substance.Create(new SubstanceDto
            {
                SubstanceGroupName = "",
                Name = "paracetamol"
            });

            PersistSubstance(Context.CurrentSession(), subst);
        }
        public void ThatSubstanceCanBeAdded()
        {
            var subst = Substance.Create(SubstanceTestFixtures.GetSubstanceWithGroup());
            var repos = new SubstanceRepository(GenFormApplication.SessionFactory)
            {
                subst
            };

            Assert.IsTrue(repos.Contains(subst));
        }
        private Substance GetSubstanceWithGroup()
        {
            var dto   = SubstanceTestFixtures.GetSubstanceWithGroup();
            var subst = Substance.Create(dto);
            var group = SubstanceGroup.Create(new SubstanceGroupDto {
                Name = dto.SubstanceGroupName
            });

            group.AddSubstance(subst);
            return(subst);
        }
 public void ThatSubstanceCannotBeCreatedWithoutName()
 {
     try
     {
         Substance.Create(new SubstanceDto());
         Assert.Fail();
     }
     catch (System.Exception e)
     {
         Assert.IsNotInstanceOfType(e, typeof(AssertFailedException));
     }
 }
Exemplo n.º 6
0
 private static ISubstance CreateTestSubstance()
 {
     return(Substance.Create(new SubstanceDto {
         Name = "paracetamol"
     }));
 }
        public static Substance CreateSubstanceWitGroup()
        {
            var group = SubstanceGroupTestFixtures.CreateSubstanceGroup();

            return(Substance.Create(GetSubstanceDtoWithoutGroup(), group));
        }
 public static Substance CreateSubstanceWithoutGroup()
 {
     return(Substance.Create(GetSubstanceDtoWithoutGroup()));
 }