protected override SiteSettings GetSiteSettings()
        {
            IUnitOfWork unitOfWork         = CreateUnitOfWork();
            var         settingsRepository = new LightSpeedSettingsRepository(unitOfWork);

            return(settingsRepository.GetSiteSettings());
        }
        protected override bool HasEmptyTables()
        {
            IUnitOfWork unitOfWork = CreateUnitOfWork();

            var settingsRepository = new LightSpeedSettingsRepository(unitOfWork);
            var userRepository     = new LightSpeedUserRepository(unitOfWork);
            var pageRepository     = new LightSpeedPageRepository(unitOfWork);

            return(pageRepository.AllPages().Count() == 0 &&
                   pageRepository.AllPageContents().Count() == 0 &&
                   userRepository.FindAllAdmins().Count() == 0 &&
                   userRepository.FindAllEditors().Count() == 0 &&
                   settingsRepository.GetSiteSettings() != null);
        }
Beispiel #3
0
        public void GetSettingsRepository_should_return_correct_lightspeedrepository(string provider, string connectionString, DataProvider expectedProvider)
        {
            // Arrange
            var factory = new RepositoryFactory(provider, connectionString);

            SetUnitOfWork(factory);

            // Act
            ISettingsRepository repository = factory.GetSettingsRepository(provider, connectionString);

            // Assert
            LightSpeedSettingsRepository lightSpeedRepository = repository as LightSpeedSettingsRepository;

            Assert.That(lightSpeedRepository, Is.Not.Null);
        }
Beispiel #4
0
        public void GetSettingsRepository_should_default_to_sqlserver_lightspeedrepository()
        {
            // Arrange
            string provider         = "anything";
            string connectionString = "connection-string";
            var    factory          = new RepositoryFactory(provider, connectionString);

            SetUnitOfWork(factory);

            // Act
            ISettingsRepository repository = factory.GetSettingsRepository(provider, connectionString);

            // Assert
            LightSpeedSettingsRepository lightSpeedRepository = repository as LightSpeedSettingsRepository;

            Assert.That(lightSpeedRepository, Is.Not.Null);
        }