public void SetUp() { _navigation = new Mock<INavigationService>(); _cardProvider = new Mock<BaseCardProvider>(); _tile = new Mock<ISecondaryTileService>(); _statistics = new Mock<StatisticsService>(); var settingsLoader = new Mock<ISettingsLoader>(); settingsLoader.Setup(s => s.GetSettings()) .Returns(new ApplicationSettings {Password = "******", AskPassword = true}); _applicationSettingsProvider = new ApplicationSettingsProvider(settingsLoader.Object); }
public void LoadsSettingsFromSource() { var settings = new ApplicationSettings { Password = "******" }; var settingsLoader = new Mock<ISettingsLoader>(); settingsLoader.Setup(s => s.GetSettings()) .Returns(settings); var target = new ApplicationSettingsProvider(settingsLoader.Object); settingsLoader.Verify(s => s.GetSettings(),Times.AtLeastOnce()); Assert.AreEqual(settings.Password, target.Password); }
public void DoesNotAcceptNullLoader() { var target = new ApplicationSettingsProvider(null); }