Beispiel #1
0
        public void TestIsInstance()
        {
            Assert.False(IsPatternExpressionSyntaxWrapper.IsInstance(null));
            Assert.False(IsPatternExpressionSyntaxWrapper.IsInstance(SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression)));

            var syntaxNode = SyntaxFactory.IsPatternExpression(SyntaxFactory.DefaultExpression(SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.IntKeyword))), SyntaxFactory.ConstantPattern(SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression)));

            Assert.True(IsPatternExpressionSyntaxWrapper.IsInstance(syntaxNode));
        }
Beispiel #2
0
 public void TestIsInstance()
 {
     Assert.False(IsPatternExpressionSyntaxWrapper.IsInstance(null));
     Assert.False(IsPatternExpressionSyntaxWrapper.IsInstance(SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression)));
 }