public void IsDataDirtyTest(WQProfileEntity entity, object domain, bool expectedIsDirty) { var builder = new SiteDomainBuilder(); var actualDirty = builder.IsDataDirty(entity, domain); Assert.AreEqual(expectedIsDirty, actualDirty); }
public bool IsDataDirty(WQProfileEntity entity, object domain) { if(domain == null) { return true; } var dataNeedToCompare = (Hatfield.EnviroData.DataProfile.WQ.Models.Site)entity; var dataToCompare = (Hatfield.EnviroData.Core.Site)domain; if(dataNeedToCompare == null || dataToCompare == null) { throw new InvalidCastException("Entity or domain is not supported by the site domain builder."); } return !WaterQualityEntityComparer.AreValueEqual(dataNeedToCompare, dataToCompare); }
public bool IsDataDirty(WQProfileEntity entity, object domain) { if (domain == null) { return(true); } var dataNeedToCompare = (Hatfield.EnviroData.DataProfile.WQ.Models.Site)entity; var dataToCompare = (Hatfield.EnviroData.Core.Site)domain; if (dataNeedToCompare == null || dataToCompare == null) { throw new InvalidCastException("Entity or domain is not supported by the site domain builder."); } return(!WaterQualityEntityComparer.AreValueEqual(dataNeedToCompare, dataToCompare)); }