Example #1
0
 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);
     }
 }
Example #2
0
        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);
        }
Example #3
0
 public static void IsNotDefault(IComplexConfig cfg, string message = "Configuration is not in default state")
 => Assert.IsFalse(AreEqualAllProperties(cfg, new ComplexConfig()), message);
Example #4
0
 public static void IsDefault(IComplexConfig cfg)
 => AssertEqualProperties(cfg, new ComplexConfig());