コード例 #1
0
 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);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 public void DoesNotAcceptNullLoader()
 {
     var target = new ApplicationSettingsProvider(null);
 }