private static Substance CreateSubstanceWithGroup() { var group = SubstanceGroup.Create(new SubstanceGroupDto { Name = "analgetica" }); var subst = Substance.Create(SubstanceTestFixtures.GetSubstanceWithGroup()); group.AddSubstance(subst); return(subst); }
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)); } }
public static SubstanceGroup CreateSubstanceGroup() { return(SubstanceGroup.Create(GetSubstanceGroupDtoWithoutItems())); }