Esempio n. 1
0
        public void GetRepository_should_return_correct_lightspeedrepository(string provider, string connectionString, DataProvider expectedProvider, Type expectedSchemaType)
        {
            // Arrange + Act
            IInstallerRepository installerRepository = _installationService.GetRepository(provider, connectionString);

            // Assert
            LightSpeedInstallerRepository lightSpeedInstallerRepository = installerRepository as LightSpeedInstallerRepository;

            Assert.That(lightSpeedInstallerRepository, Is.Not.Null);
            Assert.That(lightSpeedInstallerRepository.ConnectionString, Is.EqualTo(connectionString));
            Assert.That(lightSpeedInstallerRepository.DataProvider, Is.EqualTo(expectedProvider));
            Assert.That(lightSpeedInstallerRepository.Schema, Is.TypeOf(expectedSchemaType));
        }
Esempio n. 2
0
        public void GetRepository_should_default_to_sqlserver_lightspeedrepository()
        {
            // Arrange
            string provider           = "anything";
            string connectionString   = "connection-string";
            Type   expectedSchemaType = typeof(SqlServerSchema);

            // Act
            IInstallerRepository installerRepository = _installationService.GetRepository(provider, connectionString);

            // Assert
            LightSpeedInstallerRepository lightSpeedInstallerRepository = installerRepository as LightSpeedInstallerRepository;

            Assert.That(lightSpeedInstallerRepository, Is.Not.Null);
            Assert.That(lightSpeedInstallerRepository.ConnectionString, Is.EqualTo(connectionString));
            Assert.That(lightSpeedInstallerRepository.DataProvider, Is.EqualTo(DataProvider.SqlServer2008));
            Assert.That(lightSpeedInstallerRepository.Schema, Is.TypeOf(expectedSchemaType));
        }