예제 #1
0
        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.");
        }
예제 #2
0
        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.");
        }
예제 #3
0
        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.");
        }
예제 #4
0
            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));
            }