Esempio n. 1
0
        public void CalculationTest()
        {
            var    calculator = new Multiplicator();
            double actual     = calculator.calculate(2, 3);

            Assert.AreEqual(6, actual, 0.00);
        }
            public void CalculateTest(double firstValue, double secondValue, double expected)
            {
                Multiplicator calculator   = new Multiplicator();
                var           actualResult = calculator.calculate(firstValue, secondValue);

                Assert.AreEqual(expected, actualResult);
            }
        public void calculateTest()
        {
            Multiplicator calculator = new Multiplicator();

            Assert.AreEqual(10, calculator.calculate(2, 5));
            Assert.AreEqual(36, calculator.calculate(4, 9));
            Assert.AreEqual(0.75, calculator.calculate(0.25, 3));
        }
        private Int32 Area(Region r, Multiplicator m)
        {
            Region next = r;

            for (int i = 0; i < (Int32)m * delta; i++)
            {
                if ((next = r.Parent) == null)
                {
                    throw new NullReferenceException();
                }
            }

            return next.Area;
        }
Esempio n. 5
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (XCoord != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(XCoord);
            }
            if (YCoord != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(YCoord);
            }
            if (DistanceToCenter != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DistanceToCenter);
            }
            if (HitTheBoard != false)
            {
                hash ^= HitTheBoard.GetHashCode();
            }
            if (Multiplicator != 0)
            {
                hash ^= Multiplicator.GetHashCode();
            }
            if (Angle != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Angle);
            }
            if (PointSlot != 0)
            {
                hash ^= PointSlot.GetHashCode();
            }
            if (Points != 0)
            {
                hash ^= Points.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        private Region QRegion(Region r, Int32 step, Multiplicator m)
        {
            Region next = r;

            for (Int32 i = 0; i < (Int32)m * step; i++)
            {
                if ((next = r.Parent) == null)
                {
                    throw new NullReferenceException();
                }
            }

            return next;
        }
 public void Initialize()
 {
     this.multiplicator = new Multiplicator();
 }
Esempio n. 8
0
 private void TestMultiplication(int x, int y)
 {
     Assert.AreEqual(x * y, Multiplicator.Mul(x, y));
 }