Пример #1
0
        public void SarifSnapshot_TryGetValue_NoLineNumber()
        {
            SarifErrorListItem errorItem = new SarifErrorListItem();

            SarifSnapshot snapshot = new SarifSnapshot(String.Empty, new List<SarifErrorListItem>() { errorItem });

            Object value;
            snapshot.TryGetValue(0, "line", out value).Should().Be(true);
            value.Should().Be(-1);
        }
Пример #2
0
        public void SarifSnapshot_TryGetValue_NegativeLineNumber()
        {
            int lineNumber = -10;

            SarifErrorListItem errorItem = new SarifErrorListItem();
            errorItem.LineNumber = lineNumber;

            SarifSnapshot snapshot = new SarifSnapshot(String.Empty, new List<SarifErrorListItem>() { errorItem });

            Object value;
            snapshot.TryGetValue(0, "line", out value).Should().Be(true);
            value.Should().Be(lineNumber - 1);
        }
        public void SarifSnapshot_TryGetValue_NoLineNumber()
        {
            SarifErrorListItem errorItem = new SarifErrorListItem();

            SarifSnapshot snapshot = new SarifSnapshot(String.Empty, new List <SarifErrorListItem>()
            {
                errorItem
            });

            Object value;

            snapshot.TryGetValue(0, "line", out value).Should().Be(true);
            value.Should().Be(-1);
        }
        public void SarifSnapshot_TryGetValue_NegativeLineNumber()
        {
            int lineNumber = -10;

            SarifErrorListItem errorItem = new SarifErrorListItem();

            errorItem.LineNumber = lineNumber;

            SarifSnapshot snapshot = new SarifSnapshot(String.Empty, new List <SarifErrorListItem>()
            {
                errorItem
            });

            Object value;

            snapshot.TryGetValue(0, "line", out value).Should().Be(true);
            value.Should().Be(lineNumber - 1);
        }