コード例 #1
0
        public void Item_GetUnknownItem_ReturnsNull()
        {
            CreateFontsAndColorItems();
            AddDefaultTextAndBackgroundColorToRules();

            global::EnvDTE.ColorableItems colorableItems = items.Item("Unknown item");

            Assert.IsNull(colorableItems);
        }
コード例 #2
0
        public void Item_GetPlainTextItemInUpperCase_ReturnsColorableItems()
        {
            CreateFontsAndColorItems();
            AddDefaultTextAndBackgroundColorToRules();

            global::EnvDTE.ColorableItems colorableItems = items.Item("PLAIN TEXT");
            string name = colorableItems.Name;

            Assert.AreEqual("Plain Text", name);
        }
コード例 #3
0
        public void Item_GetPlainTextItemWhenCustomHighlightingColorDoesNotExist_ReturnsPlainTextItemWithDefaultBackgroundColor()
        {
            CreateFontsAndColorItems();

            global::EnvDTE.ColorableItems colorableItems = items.Item("Plain Text");
            uint  backgroundOleColor = colorableItems.Background;
            Color backgroundColor    = ColorHelper.ConvertToColor(backgroundOleColor);

            Assert.AreEqual(ColorableItems.DefaultBackgroundColor, backgroundColor);
        }
コード例 #4
0
        public void Item_DefaultTextBackgroundColorIsBlue_PlainTextItemBackgroundIsBlue()
        {
            CreateFontsAndColorItems();
            CustomizedHighlightingColor defaultColor = AddDefaultTextAndBackgroundColorToRules();

            defaultColor.Background = Colors.Blue;

            global::EnvDTE.ColorableItems colorableItems = items.Item("Plain Text");
            uint  backgroundOleColor = colorableItems.Background;
            Color backgroundColor    = ColorHelper.ConvertToColor(backgroundOleColor);

            Assert.AreEqual(Colors.Blue, backgroundColor);
        }
コード例 #5
0
        public void Item_GetPlainTextItemWhenCustomHighlightingColorDoesNotExist_PlainTextItemAddedToCustomizationColorsWhenBoldIsSetToTrue()
        {
            CreateFontsAndColorItems();

            global::EnvDTE.ColorableItems colorableItems = items.Item("Plain Text");
            colorableItems.Bold = true;

            CustomizedHighlightingColor color =
                fakeHighlightingRules
                .ColorsSaved
                .Find(c => c.Name == CustomizingHighlighter.DefaultTextAndBackground);

            Assert.IsNotNull(color);
        }