public async Task ShouldVerifySameTableTurkishAsync() { //NH-3063 // Turkish have unusual casing rules for the letter 'i'. This test verifies that // code paths executed by the SchemaValidator correctly handles case insensitive // comparisons for this. // Just make sure that we have an int property in the mapped class. This is // the 'i' we rely on for the test. var v = new Version(); Assert.That(v.Id, Is.TypeOf <int>()); var cfg = BuildConfiguration(_version1Resource); var export = new SchemaExport(cfg); await(export.CreateAsync(true, true)); try { var validator = new Tool.hbm2ddl.SchemaValidator(cfg); await(validator.ValidateAsync()); } finally { await(export.DropAsync(true, true)); } }
public void ShouldNotVerifyModifiedTableAsync() { var cfgV2 = BuildConfiguration(_version2Resource); var validatorV2 = new Tool.hbm2ddl.SchemaValidator(cfgV2); Assert.That( () => validatorV2.ValidateAsync(), Throws.TypeOf <SchemaValidationException>() .And.Message.EqualTo("Schema validation failed: see list of validation errors") .And.Property("ValidationErrors").Some.Contains("Missing column: Name in ").IgnoreCase.And.Contains("Version").IgnoreCase); }
public Task ShouldVerifySameTableAsync() { try { var validator = new Tool.hbm2ddl.SchemaValidator((_configuration1)); return(validator.ValidateAsync()); } catch (System.Exception ex) { return(Task.FromException <object>(ex)); } }
public async Task ShouldVerifyAsync() { var validator = new Tool.hbm2ddl.SchemaValidator(cfg); try { await(validator.ValidateAsync()); } catch (SchemaValidationException sve) { Assert.Fail("Validation failed: {0}.\n{1}", StringHelper.CollectionToString(sve.ValidationErrors), sve); } }
public void ShouldNotVerifyMultiModifiedTableAsync() { var cfg = BuildConfiguration(_version3Resource); var validator = new Tool.hbm2ddl.SchemaValidator(cfg); var error = Assert.ThrowsAsync <SchemaValidationException>(() => validator.ValidateAsync()); Assert.That(error, Has.Message.EqualTo("Schema validation failed: see list of validation errors") .And.Property("ValidationErrors").Some.Contains("Missing column: Name in ").IgnoreCase.And.Contains("Version").IgnoreCase); Assert.That(error, Has.Property("ValidationErrors").Some.Contains("Missing column: Title in ").IgnoreCase.And.Contains("Version").IgnoreCase); Assert.That(error, Has.Property("ValidationErrors").Some.Contains("Missing sequence or table: ").IgnoreCase.And.Contains("id_table").IgnoreCase); }
public async Task ShouldVerifySameTableAsync() { var validator = new Tool.hbm2ddl.SchemaValidator((_configuration1)); return(validator.ValidateAsync()); }