public void Test_valid_values_for_ulong()
 {
     foreach (uint i in TwoPowers)
     {
         Assert.IsTrue(IntegerUtil.IsPowerOfTwo((ulong)i), String.Format("{0} is not a power of two!", i));
     }
 }
        public void Test_negative_values()
        {
            Random rng = new Random(12345678);

            for (int i = 0; i != 2000000; ++i)
            {
                int v = rng.Next(int.MinValue, 0);

                Assert.IsFalse(IntegerUtil.IsPowerOfTwo(v), String.Format("{0} is a power of two!", v));
            }
        }
        public void Test_some_invalid_values()
        {
            Random rng = new Random(12345678);

            for (int i = 0; i != 100000; ++i)
            {
                int v = rng.Next();

                if (!TwoPowers.Contains((uint)v))
                {
                    Assert.IsFalse(IntegerUtil.IsPowerOfTwo(v));
                }
            }
        }