Beispiel #1
0
        public void CreateFillsBrushes(Color?foreground, Color?background)
        {
            var factory        = new TextFormattingRunPropertiesFactory();
            var textProperties = factory.Create(foreground, background);

            textProperties.BackgroundBrushEmpty.Should().Be(!background.HasValue);
            textProperties.ForegroundBrushEmpty.Should().Be(!foreground.HasValue);
            TestSolidColorBrush(textProperties.BackgroundBrush, background);
            TestSolidColorBrush(textProperties.ForegroundBrush, foreground);
        }
Beispiel #2
0
        public void GetTheme(Brush foreground, Brush background, Theme?expectedTheme)
        {
            var textPropertiesFactory   = new TextFormattingRunPropertiesFactory();
            var textProperties          = textPropertiesFactory.Create(foreground, background);
            var classificationFormatMap = Substitute.For <IClassificationFormatMap>();

            classificationFormatMap.DefaultTextProperties.Returns(textProperties);

            var classificationFormatMapService = Substitute.For <IClassificationFormatMapService>();

            classificationFormatMapService.GetClassificationFormatMap(Arg.Any <string>())
            .Returns(classificationFormatMap);

            var environmentService = new EnvironmentService(classificationFormatMapService);
            var actualTheme        = environmentService.GetTheme();

            actualTheme.Should().Be(expectedTheme);
        }