public void AssignCascadeStyle() { var hbm = new HbmOneToOne(); var mapper = new OneToOneMapper(null, hbm); mapper.Cascade(Mapping.ByCode.Cascade.Persist | Mapping.ByCode.Cascade.Remove); Assert.That(hbm.cascade.Split(',').Select(w => w.Trim()), Contains.Item("persist").And.Contains("delete")); }
public void AutoCleanUnsupportedCascadeStyle() { var hbm = new HbmOneToOne(); var mapper = new OneToOneMapper(null, hbm); mapper.Cascade(Mapping.ByCode.Cascade.Persist | Mapping.ByCode.Cascade.DeleteOrphans | Mapping.ByCode.Cascade.Remove); hbm.cascade.Split(',').Select(w => w.Trim()).All(w => w.Satisfy(cascade => !cascade.Contains("orphan"))); }