Example #1
0
 public static IEnumerable <object[]> GetUnaryOperatorPairsData()
 {
     foreach (var unary in SyntaxFacts.GetUnaryOperatorKinds())
     {
         foreach (var binary in SyntaxFacts.GetBinaryOperatorKinds())
         {
             yield return(new object[] { unary, binary });
         }
     }
 }
Example #2
0
 private static IEnumerable <object[]> GetUnaryOperatorsData()
 {
     foreach (var op1 in SyntaxFacts.GetUnaryOperatorKinds())
     {
         foreach (var op2 in SyntaxFacts.GetBinaryOperatorKinds())
         {
             yield return(new object[] { op1, op2 });
         }
     }
 }
Example #3
0
    public static void GetUnaryOperatorKinds()
    {
        var operatorKinds = SyntaxFacts.GetUnaryOperatorKinds().ToArray();

        Assert.Multiple(() =>
        {
            Assert.That(operatorKinds.Length, Is.EqualTo(4), nameof(operatorKinds.Length));
            Assert.That(operatorKinds, Contains.Item(SyntaxKind.PlusToken), nameof(SyntaxKind.PlusToken));
            Assert.That(operatorKinds, Contains.Item(SyntaxKind.MinusToken), nameof(SyntaxKind.MinusToken));
            Assert.That(operatorKinds, Contains.Item(SyntaxKind.BangToken), nameof(SyntaxKind.BangToken));
            Assert.That(operatorKinds, Contains.Item(SyntaxKind.TildeToken), nameof(SyntaxKind.TildeToken));
        });
    }
Example #4
0
 public static Arbitrary <UnaryOperatorSyntaxKind> UnaryOperatorSyntaxKind() =>
 Gen.Elements(SyntaxFacts.GetUnaryOperatorKinds())
 .Select(x => new UnaryOperatorSyntaxKind(x))
 .ToArbitrary();