public static void AssertEqualProperties(IComplexConfig x, IComplexConfig y) { foreach (var p in typeof(ITestConfiguration).GetProperties()) { Assert.AreEqual(p.GetValue(y), p.GetValue(x), "Property " + p.Name); } }
public static bool AreEqualAllProperties(IComplexConfig x, IComplexConfig y) { var equals = true; foreach (var p in typeof(ITestConfiguration).GetProperties()) { equals = equals && p.GetValue(y).Equals(p.GetValue(x)); } return(equals); }
public static void IsNotDefault(IComplexConfig cfg, string message = "Configuration is not in default state") => Assert.IsFalse(AreEqualAllProperties(cfg, new ComplexConfig()), message);
public static void IsDefault(IComplexConfig cfg) => AssertEqualProperties(cfg, new ComplexConfig());