Example #1
0
        public void CombinedTypesOperationsWork()
        {
            byte   ub = 1;
            sbyte  sb = 2;
            ushort us = 3;
            short  ss = 4;
            uint   ui = 5;
            int    si = 6;
            ulong  ul = 7;

            long l1 = (long)byte.MaxValue + 1;
            long l2 = (long)sbyte.MaxValue + 1;
            long l3 = (long)ushort.MaxValue + 1;
            long l4 = (long)short.MaxValue + 1;
            long l5 = (long)uint.MaxValue + 1;
            long l6 = (long)int.MaxValue + 1;
            long l7 = (long)ulong.MinValue + 1;

            NumberHelper.AssertLong("257", ub + l1);
            NumberHelper.AssertLong("130", sb + l2);
            NumberHelper.AssertLong("65539", us + l3);
            NumberHelper.AssertLong("32772", ss + l4);
            NumberHelper.AssertLong("4294967301", ui + l5);
            NumberHelper.AssertLong("2147483654", si + l6);
            NumberHelper.AssertLong("8", (long)ul + l7);

            decimal dcml = 11m;
            double  dbl  = 12d;
            float   flt  = 13;

            long l = 100;

            NumberHelper.AssertDecimal("111", dcml + l, null);
            NumberHelper.AssertDouble("112", dbl + l, null);
            NumberHelper.AssertFloat("113", flt + l, null);
        }
Example #2
0
 public void MinMaxValuesAreCorrect()
 {
     NumberHelper.AssertLong("-9223372036854775808", long.MinValue);
     NumberHelper.AssertLong("9223372036854775807", long.MaxValue);
 }