示例#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);
        }
示例#2
0
        public void CorrectlyMapSubstanceWithGroup()
        {
            var group    = SubstanceGroup.Create(GetSubstanceGroupDto());
            var comparer = (IEqualityComparer) new SubstanceComparer();

            new PersistenceSpecification <Substance>(Context.CurrentSession(), comparer)
            .CheckProperty(s => s.Name, "paracetamol")
            .CheckReference(s => s.SubstanceGroup, group, ((s, y) => s.SetSubstanceGroup(y)))
            .VerifyTheMappings();
        }
        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 ThatSubstanceGroupWithoutNameCannotBeCreated()
 {
     try
     {
         SubstanceGroup.Create(new SubstanceGroupDto());
         Assert.Fail();
     }
     catch (System.Exception e)
     {
         Assert.IsNotInstanceOfType(e, typeof(AssertFailedException));
     }
 }
示例#5
0
 public static SubstanceGroup CreateSubstanceGroup()
 {
     return(SubstanceGroup.Create(GetSubstanceGroupDtoWithoutItems()));
 }