public void AutoCleanUnsupportedCascadeStyle() { var hbmMapping = new HbmMapping(); var hbm = new HbmManyToOne(); var mapper = new ManyToOneMapper(null, hbm, hbmMapping); 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"))); }
public void AssignCascadeStyle() { var hbmMapping = new HbmMapping(); var hbm = new HbmManyToOne(); var mapper = new ManyToOneMapper(null, hbm, hbmMapping); mapper.Cascade(Mapping.ByCode.Cascade.Persist | Mapping.ByCode.Cascade.Remove); hbm.cascade.Split(',').Select(w => w.Trim()).Should().Contain("persist").And.Contain("delete"); }