Example #1
0
        public void MongoPersistenceWithWrongConnectionStringName(Configure config)
        {
            config.Invoking(c => c.MongoPersistence("Missing.Persistence"))
            .ShouldThrow <ConfigurationErrorsException>()
            .WithMessage("Cannot configure Mongo Persister. No connection string named Missing.Persistence was found");

            Configure.Instance.Configurer.HasComponent <MongoClientAccessor>().Should().BeFalse();
            Configure.Instance.Configurer.HasComponent <MongoDatabaseFactory>().Should().BeFalse();
        }
        public void MongoPersistenceWithWrongConnectionStringName(Configure config)
        {
            config.Invoking(c => c.MongoPersistence("Missing.Persistence"))
                  .ShouldThrow<ConfigurationErrorsException>()
                  .WithMessage("Cannot configure Mongo Persister. No connection string named Missing.Persistence was found");

            Configure.Instance.Configurer.HasComponent<MongoClientAccessor>().Should().BeFalse();
            Configure.Instance.Configurer.HasComponent<MongoDatabaseFactory>().Should().BeFalse();
        }
Example #3
0
        public void MongoPersistenceWithConnectionStringLambdaReturningEmpty(Configure config)
        {
            config.Invoking(c => c.MongoPersistence(() => string.Empty))
            .ShouldThrow <ConfigurationErrorsException>()
            .WithMessage("Cannot configure Mongo Persister. Connection string can not be null or empty.");

            Configure.Instance.Configurer.HasComponent <MongoClientAccessor>().Should().BeFalse();
            Configure.Instance.Configurer.HasComponent <MongoDatabaseFactory>().Should().BeFalse();
        }
        public void MongoPersistenceWithConnectionStringLambdaReturningEmpty(Configure config)
        {
            config.Invoking(c => c.MongoPersistence(() => string.Empty))
                  .ShouldThrow<ConfigurationErrorsException>()
                  .WithMessage("Cannot configure Mongo Persister. Connection string can not be null or empty.");

            Configure.Instance.Configurer.HasComponent<MongoClientAccessor>().Should().BeFalse();
            Configure.Instance.Configurer.HasComponent<MongoDatabaseFactory>().Should().BeFalse();
        }