コード例 #1
0
        public void ValidReferenceShouldBeEqualToItself(ValidCase @case)
        {
            var first  = Parse(@case.Value);
            var second = Parse(@case.Value);

            first.Equals(second).Should().Be(true);
            first.GetHashCode().Should().Be(second.GetHashCode());
        }
コード例 #2
0
        public void ValidReferenceShouldBeUriParseable(ValidCase @case)
        {
            var parsed = Parse(@case.Value);

            // the go2def flow in the language server passes the reference through URIs
            // in cases of documents that come from the local module cache
            FluentActions.Invoking(() => new Uri(parsed.FullyQualifiedReference)).Should().NotThrow();

            // the unqualified reference should be parseable as a URI segment as well
            FluentActions.Invoking(() => new Uri("test://" + parsed.UnqualifiedReference)).Should().NotThrow();
        }
コード例 #3
0
        public void ValidReferencesShouldParseCorrectly(ValidCase @case)
        {
            var parsed = Parse(@case.Value);

            using (new AssertionScope())
            {
                parsed.Registry.Should().Be(@case.ExpectedRegistry);
                parsed.Repository.Should().Be(@case.ExpectedRepository);
                parsed.Tag.Should().Be(@case.ExpectedTag);
                parsed.ArtifactId.Should().Be(@case.Value);
            }
        }