public async Task Should_detect_existing_TimeoutEntity_index_in_default_configuration() { var configuration = await CreateTimeoutManagerObjects(); var validationResult = new TimeoutsIndexValidator(configuration).Validate(); Assert.IsTrue(validationResult.IsValid, "Validation should pass for default db structure."); }
public async Task Should_detect_existing_TimeoutEntity_index_in_quoted_schema() { dbSchemaName = "quoted-schema"; dbSchemaNeedsQuoting = true; var configuration = await CreateTimeoutManagerObjects(); var validationResult = new TimeoutsIndexValidator(configuration).Validate(); Assert.IsTrue(validationResult.IsValid, "Validation should pass for existing index in quoted schema."); }
public async Task Should_detect_missing_TimeoutEntity_index_in_unquoted_schema() { dbSchemaName = "some_schema"; var configuration = await CreateTimeoutManagerObjects(); await DropIndex(); var validationResult = new TimeoutsIndexValidator(configuration).Validate(); Assert.IsFalse(validationResult.IsValid, "Validation should fail if the index is missing."); }
protected override Task OnStart(IMessageSession session) { var result = new TimeoutsIndexValidator(configuration).Validate(); if (result.IsValid) { return(Task.FromResult(0)); } if (result.Exception != null) { Logger.Warn(result.ErrorDescription, result.Exception); } else { Logger.Warn(result.ErrorDescription); } return(Task.FromResult(0)); }