Exemplo n.º 1
0
 public void VerifyStatementWithComments(IdentifierPath packagePath, WhiteSpaceAndCommentOption options)
 {
     ExpectedProto.Items.Add(new PackageStatement {
         PackagePath = packagePath
     });
     RenderingOptions = new StringRenderingOptions {
         WhiteSpaceAndCommentRendering = options
     };
 }
Exemplo n.º 2
0
        public void CannotHaveMoreThanOneStatement(IdentifierPath packagePath)
        {
            var expectedProtoItems = ExpectedProto.Items;

            expectedProtoItems.Add(new PackageStatement {
                PackagePath = packagePath
            });
            expectedProtoItems.Add(new PackageStatement {
                PackagePath = packagePath
            });

            var expectedMessage = $"Cannot have more than one '{typeof(PackageStatement).FullName}'.";

            // Most times we can wait for Dispose to process the Expected Target, but this is an Exception.
            VerifyParse(x => x.ToDescriptorString()
                        , (InvalidOperationException actualException)
                        => Assert.Equal(expectedMessage, actualException.VerifyNotNull().Message)
                        );
        }
 /// <summary>
 /// Visits the <paramref name="path"/>.
 /// </summary>
 /// <param name="path"></param>
 protected virtual void VisitIdentifierPath(IdentifierPath path)
 {
 }
Exemplo n.º 4
0
 /// <inheritdoc />
 public override bool Equals(IdentifierPath other) => Equals(this, other as ElementTypeIdentifierPath);
Exemplo n.º 5
0
 /// <summary>
 /// Returns whether <paramref name="a"/> Equals <paramref name="b"/>.
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b"></param>
 /// <returns></returns>
 protected internal static bool Equals(ElementTypeIdentifierPath a, ElementTypeIdentifierPath b)
 => IdentifierPath.Equals(a, b) &&
 a.IsGlobalScope == b.IsGlobalScope;
Exemplo n.º 6
0
 public void VerifyGivenFullIdentifierSpecs(IdentifierPath packagePath)
 {
     ExpectedProto.Items.Add(new PackageStatement {
         PackagePath = packagePath
     });
 }