Пример #1
0
        public void LoadFronJSON_CurrentFormat_DataIsCorrect()
        {
            ConfigurationModel config = ConfigurationModel.LoadFromJSON(@"..\..\Resources\ConfigSettings.json", testProvider);

            ConfirmOverrideConfigMatchesExpectation(config,
                                                    issueReporterSerializedConfigs: @"{""27f21dff-2fb3-4833-be55-25787fce3e17"":""hello world""}",
                                                    selectedIssueReporter: new Guid("{27f21dff-2fb3-4833-be55-25787fce3e17}"),
                                                    releaseChannel: ReleaseChannel.Canary
                                                    );
        }
        public void ConfigurationModelTest()
        {
            string path = Path.Combine(testProvider.ConfigurationFolderPath, "config.test");

            var coreProps = PropertySettings.DefaultCoreProperties;

            ConfigurationModel config = new ConfigurationModel
            {
                CoreProperties = coreProps,
                Version        = ConfigurationModel.CurrentVersion
            };

            config.SerializeInJSON(path);

            var newConfig = ConfigurationModel.LoadFromJSON(path, testProvider);

            File.Delete(path);

            Assert.IsTrue(coreProps.SequenceEqual(newConfig.CoreProperties));
        }
Пример #3
0
        public void ConfigurationModelTest()
        {
            string path = Path.Combine(DirectoryManagement.sUserDataFolderPath, "config.test");

            var coreProps = DesktopElementHelper.GetDefaultCoreProperties();

            ConfigurationModel config = new ConfigurationModel
            {
                CoreProperties = coreProps,
                Version        = ConfigurationModel.CurrentVersion
            };

            config.SerializeInJSON(path);

            var newConfig = ConfigurationModel.LoadFromJSON(path);

            File.Delete(path);

            Assert.IsTrue(coreProps.SequenceEqual(newConfig.CoreProperties));
        }
        public void GetCurrentConfigurationTest()
        {
            const string expectedHotKeyForRecord      = "Recording HotKey";
            const string expectedMainWindowActivation = "Main Window Activation HotKey";
            string       path = Path.Combine(testProvider.ConfigurationFolderPath, "config.test2");

            ConfigurationModel config = new ConfigurationModel
            {
                HotKeyForRecord = expectedHotKeyForRecord,
                HotKeyForActivatingMainWindow = expectedMainWindowActivation,
                Version = "1.0"
            };

            config.SerializeInJSON(path);

            var nc = ConfigurationModel.LoadFromJSON(path, testProvider);

            File.Delete(path);

            Assert.AreEqual(ConfigurationModel.CurrentVersion, nc.Version);
            Assert.AreEqual(expectedHotKeyForRecord, nc.HotKeyForRecord);
            Assert.AreEqual(expectedMainWindowActivation, nc.HotKeyForActivatingMainWindow);
        }
 private static ConfigurationModel GetDefaultConfig()
 {
     return(ConfigurationModel.LoadFromJSON(null, testProvider));
 }
        public void LoadFronJSON_LegacyFormat_DataIsCorrect()
        {
            ConfigurationModel config = ConfigurationModel.LoadFromJSON(@".\Resources\LegacyConfigSettings.json", testProvider);

            ConfirmOverrideConfigMatchesExpectation(config);
        }
 private static ConfigurationModel GetDefaultConfig()
 {
     return(ConfigurationModel.LoadFromJSON(@"..\..\Resources\ThisFileDoesNotExist.json"));
 }
        public void LoadFronJSON_CurrentFormat_DataIsCorrect()
        {
            ConfigurationModel config = ConfigurationModel.LoadFromJSON(@"..\..\Resources\ConfigSettings.json");

            ConfirmSharedOverrideConfigMatchesExpectation(config);
        }