public void GetUserRepository_should_return_mongodb_repository() { // Arrange string provider = "MONGODB"; string connectionString = "mongodb-connection-string"; var factory = new RepositoryFactory(provider, connectionString); SetUnitOfWork(factory); // Act IUserRepository repository = factory.GetUserRepository(provider, connectionString); // Assert MongoDBUserRepository mongoDbRepository = repository as MongoDBUserRepository; Assert.That(mongoDbRepository, Is.Not.Null); Assert.That(mongoDbRepository.ConnectionString, Is.EqualTo(connectionString)); }
public void GetUserRepository_should_return_correct_lightspeedrepository(string provider, string connectionString, DataProvider expectedProvider) { // Arrange var factory = new RepositoryFactory(provider, connectionString); SetUnitOfWork(factory); // Act IUserRepository repository = factory.GetUserRepository(provider, connectionString); // Assert LightSpeedUserRepository lightSpeedRepository = repository as LightSpeedUserRepository; Assert.That(lightSpeedRepository, Is.Not.Null); }
public void GetUserRepository_should_default_to_sqlserver_lightspeedrepository() { // Arrange string provider = "anything"; string connectionString = "connection-string"; var factory = new RepositoryFactory(provider, connectionString); SetUnitOfWork(factory); // Act IUserRepository repository = factory.GetUserRepository(provider, connectionString); // Assert LightSpeedUserRepository lightSpeedRepository = repository as LightSpeedUserRepository; Assert.That(lightSpeedRepository, Is.Not.Null); }