public void CheckerFactoryRegisterTypeViaGeneric() { var cc = new CheckerConventions(); cc.Convention <SampleClass>(CompareTarget.Ignore); Assert.That(cc.TypeConventions.CompareTarget.Convention(typeof(SampleClass)), Is.EqualTo(CompareTarget.Ignore)); }
public static void AssignTypeConventions(this CheckerConventions conventions) { // NB Must have this one to put base behaviour in suchs as Guid conventions.TypeConventions.InitializeTypeConventions(); // NB Conventions must be after general type registrations if they are to apply. conventions.Convention(x => typeof(IIdentifiable).IsAssignableFrom(x), CompareTarget.Id); }
public static void AssignPropertyInfoConventions(this CheckerConventions conventions) { //conventions.Convention(x => typeof(IIdentifiable).IsAssignableFrom(x), CompareTarget.Id); conventions.Convention((PropertyInfo x) => x.Name == "Ignore", CompareTarget.Ignore); }