Пример #1
0
        public void WithoutXamlString_Tooltip_ShouldBeMessageString()
        {
            var tag = new SarifLocationErrorTag(
                persistentSpan: null, // not touch span in the tests
                runIndex: 0,
                resultId: 0,
                errorType: PredefinedErrorTypeNames.OtherError,
                toolTipContent: ResultMessageString,
                toolTipXamlString: null,
                context: null);

            tag.Should().NotBeNull();
            tag.ToolTipContent.Should().Be(ResultMessageString);

            tag = new SarifLocationErrorTag(
                persistentSpan: null, // not touch span in the tests
                runIndex: 0,
                resultId: 0,
                errorType: PredefinedErrorTypeNames.OtherError,
                toolTipContent: ResultMessageString,
                toolTipXamlString: " ",
                context: null);

            tag.Should().NotBeNull();
            tag.ToolTipContent.Should().Be(ResultMessageString);
        }
Пример #2
0
        public void WithValidXamlString_Tooltip_ShouldBeXamlElement()
        {
            var tag = new SarifLocationErrorTag(
                persistentSpan: null, // not touch span in the tests
                runIndex: 0,
                resultId: 0,
                errorType: PredefinedErrorTypeNames.OtherError,
                toolTipContent: ResultMessageString,
                toolTipXamlString: XamlUtilitiesTests.ValidXamlWithHyperlink,
                context: null);

            tag.Should().NotBeNull();
            tag.ToolTipContent.Should().BeOfType(typeof(ScrollViewer));
        }