public void Should_HaveDetails() { var info = new HenDepreciation(); var errors = info.Validate(); Assert.True(errors.Any(e => e.Message == "HenDepreciation_RequireDetails")); }
public void Should_ConsistOf_DifferentHouses() { var houseId = Guid.NewGuid(); var info = new HenDepreciation { Date = DateTime.Today, Details = new List<HenDepreciationDetail>() { new HenDepreciationDetail {HouseId = houseId}, new HenDepreciationDetail {HouseId = houseId} } }; var errors = info.Validate(); Assert.True(errors.Any(e => e.Message == "HenDepreciation_DuplicateHouse")); }