Exemple #1
0
        public void SqrtNineInt()
        {
            int actual   = IntegerMath.Sqrt(9);
            int expected = 3;

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void Sqrt16Int()
        {
            int actual   = IntegerMath.Sqrt(16);
            int expected = 4;

            Assert.AreEqual(expected, actual);
        }
Exemple #3
0
        public void SqrtFourInt()
        {
            int actual   = IntegerMath.Sqrt(4);
            int expected = 2;

            Assert.AreEqual(expected, actual);
        }
Exemple #4
0
        public void SqrtZeroInt()
        {
            int actual   = IntegerMath.Sqrt(0);
            int expected = 0;

            Assert.AreEqual(expected, actual);
        }
Exemple #5
0
        public void SqrtMaxLong()
        {
            long actual   = IntegerMath.Sqrt(long.MaxValue);
            long expected = 3037000499L;

            Assert.AreEqual(expected, actual);
        }
Exemple #6
0
        public void SqrtMaxUlong()
        {
            ulong actual   = IntegerMath.Sqrt(ulong.MaxValue);
            ulong expected = 4294967295;

            Assert.AreEqual(expected, actual);
        }
Exemple #7
0
        public void Sqrt16Long()
        {
            long actual   = IntegerMath.Sqrt(16L);
            long expected = 4L;

            Assert.AreEqual(expected, actual);
        }
Exemple #8
0
        public void SqrtMidHighLong()
        {
            long actual   = IntegerMath.Sqrt(3037000499L);
            long expected = 55108L;

            Assert.AreEqual(expected, actual);
        }
Exemple #9
0
        public void SqrtFourLong()
        {
            long actual   = IntegerMath.Sqrt(4L);
            long expected = 2L;

            Assert.AreEqual(expected, actual);
        }
Exemple #10
0
        public void SqrtNineLong()
        {
            long actual   = IntegerMath.Sqrt(9L);
            long expected = 3L;

            Assert.AreEqual(expected, actual);
        }
Exemple #11
0
        public void SqrtTwoLong()
        {
            long actual   = IntegerMath.Sqrt(2L);
            long expected = 1L;

            Assert.AreEqual(expected, actual);
        }
Exemple #12
0
        public void SqrtZeroLong()
        {
            long actual   = IntegerMath.Sqrt(0L);
            long expected = 0L;

            Assert.AreEqual(expected, actual);
        }
Exemple #13
0
        public void SqrtMaxInt()
        {
            int actual   = IntegerMath.Sqrt(int.MaxValue);
            int expected = 46340;

            Assert.AreEqual(expected, actual);
        }
Exemple #14
0
        public void SqrtTwoInt()
        {
            int actual   = IntegerMath.Sqrt(2);
            int expected = 1;

            Assert.AreEqual(expected, actual);
        }
Exemple #15
0
        public void Sqrt16Ulong()
        {
            ulong value    = 16;
            ulong actual   = IntegerMath.Sqrt(value);
            ulong expected = 4;

            Assert.AreEqual(expected, actual);
        }
Exemple #16
0
        public void Sqrt16Short()
        {
            short value    = 16;
            short actual   = IntegerMath.Sqrt(value);
            short expected = 4;

            Assert.AreEqual(expected, actual);
        }
Exemple #17
0
        public void Sqrt16Sbyte()
        {
            sbyte value    = 16;
            sbyte actual   = IntegerMath.Sqrt(value);
            sbyte expected = 4;

            Assert.AreEqual(expected, actual);
        }
Exemple #18
0
        public void Sqrt10BigInteger()
        {
            BigInteger actual = 10;

            actual = IntegerMath.Sqrt(actual);
            BigInteger expected = 3;

            Assert.AreEqual(expected, actual);
        }
Exemple #19
0
        public void SqrtLargeBigInteger1()
        {
            BigInteger actual = long.MaxValue;

            actual = IntegerMath.Sqrt((actual * actual) + 27);
            BigInteger expected = long.MaxValue;

            Assert.AreEqual(expected, actual);
        }
Exemple #20
0
 public void SqrtExceptionLong()
 {
     Assert.ThrowsException <ArgumentOutOfRangeException>(() => IntegerMath.Sqrt(-1L));
 }