public void DefaultsToLiveDataStore(string settingValue) { // Arrange var configuration = new Mock <IConfigurationProvider>(); configuration.Setup(c => c.TryGetDataStoreType(out settingValue)).Returns(true); var factory = new AccountDataStoreFactory(configuration.Object); // Act IAccountDataStore datastore = factory.BuildAccountDataStore(); // Assert Assert.AreEqual(typeof(AccountDataStore), datastore.GetType()); }
public void UsesBackupDataStoreWhenConfigured() { // Arrange string settingValue = "Backup"; var configuration = new Mock <IConfigurationProvider>(); configuration.Setup(c => c.TryGetDataStoreType(out settingValue)).Returns(true); var factory = new AccountDataStoreFactory(configuration.Object); // Act IAccountDataStore datastore = factory.BuildAccountDataStore(); // Assert Assert.AreEqual(typeof(BackupAccountDataStore), datastore.GetType()); }