Exemple #1
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);
        }