public void SchemaNotNull_MappingNull_generates_warning() {
     var rule = new UniqueKeyMatchesMappingRule();
     var schema = new SolrSchema {UniqueKey = "id"};
     var validations = rule.Validate(typeof (SchemaMappingTestDocument), schema, new MappingManager()).ToList();
     Assert.IsNotNull(validations);
     Assert.AreEqual(1, validations.Count);
     foreach (var v in validations)
         Console.WriteLine("{0}: {1}", v.GetType(), v.Message);
     Assert.IsInstanceOfType<ValidationWarning>(validations[0]);
 }
 public void SchemaNull_MappingNotNull_generates_error() {
     var rule = new UniqueKeyMatchesMappingRule();
     var mapper = new MappingManager();
     var idProperty = typeof (SchemaMappingTestDocument).GetProperty("ID");
     mapper.Add(idProperty);
     mapper.SetUniqueKey(idProperty);
     var validations = rule.Validate(typeof (SchemaMappingTestDocument), new SolrSchema(), mapper).ToList();
     Assert.IsNotNull(validations);
     Assert.AreEqual(1, validations.Count);
     foreach (var v in validations)
         Console.WriteLine("{0}: {1}", v.GetType(), v.Message);
     Assert.IsInstanceOfType<ValidationError>(validations[0]);
 }
 public void SchemaNull_MappingNull_no_errors()
 {
     var rule = new UniqueKeyMatchesMappingRule();
     var schema = new SolrSchema();
     var validations = rule.Validate(typeof (SchemaMappingTestDocument), schema, new MappingManager()).ToList();
     Assert.IsNotNull(validations);
     Assert.AreEqual(0, validations.Count);
 }