Example #1
0
        public void PrintingIsTest()
        {
            var b = new object();

            PAssert.IsTrue(() => b is string);
        }
Example #2
0
        public void PrintingUnaryNot()
        {
            var b = true;

            PAssert.IsTrue(() => !b);
        }
Example #3
0
        public void PrintingUnaryNegate()
        {
            var b = 5;

            PAssert.IsTrue(() => - b == 0);
        }
Example #4
0
        public void PrintingLinqExpressionStatements()
        {
            var list = Enumerable.Range(0, 150);

            PAssert.IsTrue(() => (from l in list where l % 2 == 0 select l).Sum() == 0);
        }
Example #5
0
        public void PrintingComplexLinqExpressionStatements()
        {
            var list = Enumerable.Range(0, 5);

            PAssert.IsTrue(() => (from x in list from y in list where x > y select x + "," + y).Count() == 0);
        }
Example #6
0
 public void PrintingNewArrayTest()
 {
     var array = new int[]{1,2,3};
     PAssert.IsTrue(() => array.Equals(new[]{4,5,6}));
 }
Example #7
0
        public void PrintingLinqStatements()
        {
            var list = Enumerable.Range(0, 150);

            PAssert.IsTrue(() => list.Where(x => x % 2 == 0).Sum() == 0);
        }
Example #8
0
 public void PrintingDelegateMethodGroupInvocation()
 {
     var array = new int[] { 1, 2, 3 };
     PAssert.IsTrue(() => array.Any(GreaterThan3));
 }
Example #9
0
 public void PrintingEnumerablesWithNulls()
 {
     var list = new List<int?>{1,2,null,4,5};
     PAssert.IsTrue(() => list.Sum() == null);
 }
Example #10
0
 public void SequenceEqualButNotOperatorEquals()
 {
     object list = new List<int>{1,2,3};
     object array = new[] { 1, 2, 3 };
     PAssert.IsTrue(() => list == array);
 }
Example #11
0
 public void PrintingDelegateInvocation()
 {
     var array = new int[] { 1, 2, 3 };
     PAssert.IsTrue(() => array.Any(x => x > 3));
 }
Example #12
0
 public void RunTypeOfExpression()
 {
     int x = 1;
     PAssert.IsTrue(() => x.GetType() == typeof(string));
 }
Example #13
0
 public void RunStringCompare()
 {
     string s = "hello, bobby";
     Tuple<string> t = new Tuple<string>("hello, Bobby");
     PAssert.IsTrue(() => s == t.Item1);
 }
Example #14
0
 public void RunComplexExpressionWithStaticField()
 {
     int y = 6;
     DateTime d = new DateTime(2010, 3, 1);
     PAssert.IsTrue(() => field + 5 == d.Month * y);
 }
Example #15
0
 public void RunComplexExpression3()
 {
     List<int> l = new List<int> { 1, 2, 3 };
     bool b = false;
     PAssert.IsTrue(() => l[2].ToString() == (b ? "three" : "four"));
 }
Example #16
0
 public void RunComplexExpression2()
 {
     string x = " lalalaa ";
     int i = 10;
     PAssert.IsTrue(() => x.Trim().Length == Math.Max(4, new int[] { 5, 4, i / 3, 2 }[0]));
 }