提交 3aa112d2 编写于 作者: C Cyrus Najmabadi

Add test

上级 9c6f2295
...@@ -226,9 +226,13 @@ public void AddEmptySyntaxList() ...@@ -226,9 +226,13 @@ public void AddEmptySyntaxList()
} }
[Fact] [Fact]
public void AddNamespaceAttributeLists() public void AddNamespaceAttributeListsAndModifiers()
{ {
var declaration = SyntaxFactory.NamespaceDeclaration(SyntaxFactory.ParseName("M")); var declaration = SyntaxFactory.NamespaceDeclaration(SyntaxFactory.ParseName("M"));
Assert.True(declaration.AttributeLists.Count == 0);
Assert.True(declaration.Modifiers.Count == 0);
declaration = declaration.AddAttributeLists(new[] declaration = declaration.AddAttributeLists(new[]
{ {
SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList( SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(
...@@ -236,6 +240,12 @@ public void AddNamespaceAttributeLists() ...@@ -236,6 +240,12 @@ public void AddNamespaceAttributeLists()
}); });
Assert.True(declaration.AttributeLists.Count == 1); Assert.True(declaration.AttributeLists.Count == 1);
Assert.True(declaration.Modifiers.Count == 0);
declaration = declaration.AddModifiers(SyntaxFactory.Token(SyntaxKind.PublicKeyword));
Assert.True(declaration.AttributeLists.Count == 1);
Assert.True(declaration.Modifiers.Count == 1);
} }
[Fact] [Fact]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册