private static IPreferences CreatePreferences(string applicationDataFolderPath)
        {
            string applicationPath = Path.GetFullPath(@"..\..\..\..\HFM");
            var    preferences     = new InMemoryPreferencesProvider(applicationPath, applicationDataFolderPath, null);

            preferences.Set(Preference.DecimalPlaces, 0);
            preferences.Set(Preference.WebOverview, "WebOverview.xslt");
            preferences.Set(Preference.WebSummary, "WebSummary.xslt");
            preferences.Set(Preference.WebSlot, "WebSlot.xslt");
            return(preferences);
        }
        public void PreferencesModel_Load_FromPreferences()
        {
            // Arrange
            var preferences = new InMemoryPreferencesProvider();

            preferences.Set(Preference.UseProxy, true);
            var model = new PreferencesModel(preferences, new InMemoryAutoRunConfiguration());

            // Act
            model.Load();
            // Assert
            Assert.IsTrue(model.WebProxyModel.Enabled);
        }
        public void MessagesModel_Save_FormLocationAndSize()
        {
            // Arrange
            var preferences = new InMemoryPreferencesProvider();
            var model       = new MessagesModel(preferences, null);

            model.FormLocation = new Point(50, 60);
            model.FormSize     = new Size(70, 80);
            // Act
            model.Save();
            // Assert
            Assert.AreEqual(new Point(50, 60), preferences.Get <Point>(Preference.MessagesFormLocation));
            Assert.AreEqual(new Size(70, 80), preferences.Get <Size>(Preference.MessagesFormSize));
        }
        public void MessagesModel_Load_FormLocationAndSize()
        {
            // Arrange
            var preferences = new InMemoryPreferencesProvider();

            preferences.Set(Preference.MessagesFormLocation, new Point(10, 20));
            preferences.Set(Preference.MessagesFormSize, new Size(30, 40));
            var model = new MessagesModel(preferences, null);

            // Act
            model.Load();
            // Assert
            Assert.AreEqual(new Point(10, 20), model.FormLocation);
            Assert.AreEqual(new Size(30, 40), model.FormSize);
        }
        private static IFahClient SetupFahClientForHandlingLogMessages(string path)
        {
            var mockClient = new Mock <IFahClient>();

            mockClient.SetupGet(x => x.Logger).Returns(NullLogger.Instance);
            var preferences = new InMemoryPreferencesProvider(null, path, null);

            mockClient.SetupGet(x => x.Preferences).Returns(preferences);
            var settings = new ClientSettings {
                Name = "test"
            };

            mockClient.SetupProperty(x => x.Settings);
            mockClient.Object.Settings = settings;
            var connection = new MockFahClientConnection();

            mockClient.SetupGet(x => x.Connection).Returns(connection);
            return(mockClient.Object);
        }