Пример #1
0
        public void UpdateBatchColorDefinition()
        {
            var cd = new ColorDefinition(COLORS_DEFINITION_DARK_TEST_FILE);
            var batchColorDefinition = cd.GetFileColorDefinitionSet(FileExtensionSupported.BAT);

            foreach (var b in batchColorDefinition)
            {
                b.Value.Italic    = true;
                b.Value.Bold      = true;
                b.Value.ColorName = "NavajoWhite";
            }
            cd.SetFileColorDefinitionSet(FileExtensionSupported.BAT, batchColorDefinition);

            var newFileName = cd.FileName + ".json";

            cd.Save(newFileName);

            var cd2 = new ColorDefinition(newFileName);

            batchColorDefinition = cd2.GetFileColorDefinitionSet(FileExtensionSupported.BAT);

            foreach (var b in batchColorDefinition)
            {
                DS.Assert.ValueTypeProperties(b.Value, new { ColorName = "NavajoWhite", Bold = true, Italic = true });
            }
            File.Delete(newFileName);
        }
Пример #2
0
        public void LoadColorDefinitionVerifyBatchColorDefinition()
        {
            var cd = new ColorDefinition(COLORS_DEFINITION_DARK_TEST_FILE);

            var batchColorDefinition = cd.GetFileColorDefinitionSet(FileExtensionSupported.BAT);

            Assert.AreEqual(10, batchColorDefinition.Count);
            Assert.IsTrue(batchColorDefinition.Keys.ToList().Include(DS.List("Keyword", "Comment", "Flag", "Label", "EnvVar", "Redirection", "Punctuation", "Parameter", "String", "Default")));

            DS.Assert.ValueTypeProperties(batchColorDefinition["Keyword"], new { ColorName = "LightBlue", Bold = true, Italic = false });
            DS.Assert.ValueTypeProperties(batchColorDefinition["Comment"], new { ColorName = "MediumSpringGreen", Bold = false, Italic = true });
            DS.Assert.ValueTypeProperties(batchColorDefinition["Flag"], new { ColorName = "Turquoise", Bold = false, Italic = false });
            DS.Assert.ValueTypeProperties(batchColorDefinition["Label"], new { ColorName = "DarkOrange", Bold = false, Italic = false });
            DS.Assert.ValueTypeProperties(batchColorDefinition["EnvVar"], new { ColorName = "DarkSalmon", Bold = true, Italic = true });
            DS.Assert.ValueTypeProperties(batchColorDefinition["Redirection"], new { ColorName = "Red", Bold = false, Italic = false });
            DS.Assert.ValueTypeProperties(batchColorDefinition["Punctuation"], new { ColorName = "Red", Bold = false, Italic = false });
            DS.Assert.ValueTypeProperties(batchColorDefinition["Parameter"], new { ColorName = "DarkKhaki", Bold = false, Italic = false });
            DS.Assert.ValueTypeProperties(batchColorDefinition["String"], new { ColorName = "LightSkyBlue", Bold = false, Italic = false });
            DS.Assert.ValueTypeProperties(batchColorDefinition["Default"], new { ColorName = "NavajoWhite", Bold = false, Italic = false });
        }