예제 #1
0
 public void Simple()
 {
     var vector = new Vector2D(4, 7);
     vector.Increment();
     Assert.AreEqual(5, vector.X);
     Assert.AreEqual(8, vector.Y);
 }
 public void OperatorDivideDoubleExample()
 {
     var vector2D = new Vector2D(4, 12);
     var vector = vector2D/2;
     Assert.AreEqual(2, vector.X);
     Assert.AreEqual(6, vector.Y);
 }
예제 #3
0
 public void Simple()
 {
     var vector = new Vector2D { X = 1, Y = 2 };
     Assert.AreNotEqual(0, vector.GetHashCode());
     Assert.AreEqual(1, vector.X);
     Assert.AreEqual(2, vector.Y);
 }
예제 #4
0
        public void ExceptionLeftNull()
        {
            const Vector2D vector1 = null;
            var vector2 = new Vector2D(2, 2);

            var condition = vector1 <= vector2;
        }
예제 #5
0
 public void Simple()
 {
     var vector = new Vector2D { X = 1, Y = 2 };
     vector.SetValues(4, 6);
     Assert.AreEqual(4, vector.X);
     Assert.AreEqual(6, vector.Y);
 }
예제 #6
0
        public void ExceptionRightNull()
        {
            var vector1 = new Vector2D(2, 2);
            const Vector2D vector2 = null;

            var condition = vector1 >= vector2;
        }
예제 #7
0
 public void Simple()
 {
     var vector2D = new Vector2D();
     Assert.AreEqual(2, vector2D.DimensionCount);
     Assert.AreEqual(0, vector2D.X);
     Assert.AreEqual(0, vector2D.Y);
 }
 public void OperatorDivideVectorExample()
 {
     var vector2D1 = new Vector2D(4, 8);
     var vector2D2 = new Vector2D(2, 2);
     var vector = vector2D1/vector2D2;
     Assert.AreEqual(1, vector.X);
     Assert.AreEqual(2, vector.Y);
 }
예제 #9
0
        public void AbsoluteMaximumExample()
        {
            var vector1 = new Vector2D(1, -4);
            Assert.AreEqual(4, vector1.AbsoluteMaximum());

            var vector2 = new Vector2D(5, -4);
             Assert.AreEqual(5, vector2.AbsoluteMaximum());
        }
예제 #10
0
        public void Simple()
        {
            var vector = new Vector2D(23, 21);

            vector.Normalize();

            Assert.AreEqual(1, vector.Magnitude());
        }
예제 #11
0
파일: Minimum.cs 프로젝트: havok/ngenerics
        public void Simple()
        {
            var vector = new Vector2D(1, -4);

            Assert.AreEqual(-4, vector.Minimum());
            Assert.AreEqual(1, vector.X);
            Assert.AreEqual(-4, vector.Y);
        }
예제 #12
0
        public void AbsoluteMinimumIndexExample()
        {
            var vector1 = new Vector2D(1, -4);
            Assert.AreEqual(0, vector1.AbsoluteMinimumIndex());

            var vector2 = new Vector2D(-4, 1);
            Assert.AreEqual(1, vector2.AbsoluteMinimumIndex());
        }
예제 #13
0
        public void Simple()
        {
            var vector2D = new Vector2D(4, 7);

            vector2D--;

            Assert.AreEqual(3, vector2D.X);
            Assert.AreEqual(6, vector2D.Y);
        }
예제 #14
0
        public void AddDoubleExample()
        {
            var vector = new Vector2D(4, 7);

            vector.Add(1);

            Assert.AreEqual(5, vector.X);
            Assert.AreEqual(8, vector.Y);
        }
예제 #15
0
파일: Sum.cs 프로젝트: havok/ngenerics
        public void Simple()
        {
            var vector = new Vector2D(2, 3);

            Assert.AreEqual(5, vector.Sum());

            Assert.AreEqual(2, vector.X);
            Assert.AreEqual(3, vector.Y);
        }
예제 #16
0
파일: CLear.cs 프로젝트: havok/ngenerics
        public void Simple()
        {
            var vector = new Vector2D(3, 7);

            vector.Clear();

            Assert.AreEqual(0, vector.X);
            Assert.AreEqual(0, vector.Y);
        }
예제 #17
0
        public void Simple()
        {
            var vector = new Vector2D(2, 3);

            Assert.AreEqual(3.6055512754639891d, vector.Magnitude());

            Assert.AreEqual(2, vector.X);
            Assert.AreEqual(3, vector.Y);
        }
예제 #18
0
        public void Simple()
        {
            var vector = new Vector2D(2, 3);

            Assert.AreEqual(6, vector.Product());

            Assert.AreEqual(2, vector.X);
            Assert.AreEqual(3, vector.Y);
        }
예제 #19
0
        public void Double()
        {
            var vector = new Vector2D(9, 3);

            vector.Divide(3);

            Assert.AreEqual(3, vector.X);
            Assert.AreEqual(1, vector.Y);
        }
예제 #20
0
        public void Simple()
        {
            var vector = new Vector2D(1, 2);

            vector.Negate();

            Assert.AreEqual(-1, vector.X);
            Assert.AreEqual(-2, vector.Y);
        }
        public void OperatorDecrementExample()
        {
            var vector2D = new Vector2D(4, 7);

            vector2D--;

            Assert.AreEqual(3, vector2D.X);
            Assert.AreEqual(6, vector2D.Y);
        }
예제 #22
0
파일: Multiply.cs 프로젝트: havok/ngenerics
        public void Double()
        {
            var vector = new Vector2D(1, 2);

            vector.Multiply(2);

            Assert.AreEqual(2, vector.X);
            Assert.AreEqual(4, vector.Y);
        }
예제 #23
0
        public void Simple()
        {
            var vector = new Vector2D(4, 7);

            vector.Decrement();

            Assert.AreEqual(3, vector.X);
            Assert.AreEqual(6, vector.Y);
        }
예제 #24
0
        public void DifferentValues()
        {
            var vector1 = new Vector2D(1, 0);
            var vector2 = new Vector2D(2, 0);

            Assert.IsFalse(vector1.Equals(vector2));

            Assert.AreEqual(1, vector1.X);
            Assert.AreEqual(2, vector2.X);
        }
예제 #25
0
        public void Simple()
        {
            var vector1 = new Vector2D(1, 1);
            var vector2 = new Vector2D(2, 2);
            var vector3 = new Vector2D(2, 2);

            Assert.IsFalse(vector1 >= vector2);
            Assert.IsTrue(vector2 >= vector1);
            Assert.IsTrue(vector2 >= vector3);
        }
예제 #26
0
 public void Simple()
 {
     var vector2D = new Vector2D { X = 1, Y = 2 };
     var vector = -vector2D;
     Assert.AreEqual(-1, vector.X);
     Assert.AreEqual(-2, vector.Y);
     Assert.AreEqual(1, vector2D.X);
     Assert.AreEqual(2, vector2D.Y);
     Assert.AreNotSame(vector2D, vector);
 }
예제 #27
0
 public void Double()
 {
     var vector2D = new Vector2D(4, 7);
     var vector = vector2D + 2;
     Assert.AreEqual(6, vector.X);
     Assert.AreEqual(9, vector.Y);
     Assert.AreEqual(4, vector2D.X);
     Assert.AreEqual(7, vector2D.Y);
     Assert.AreNotSame(vector2D, vector);
 }
예제 #28
0
파일: Add.cs 프로젝트: GTuritto/ngenerics
        public void Double()
        {
            var vector = new Vector2D(4, 7)
                             {
                                 1
                             };

            Assert.AreEqual(5, vector.X);
            Assert.AreEqual(8, vector.Y);
        }
예제 #29
0
 public void Simple()
 {
     var vector2D1 = new Vector2D { X = 1, Y = 2 };
     var vector2D2 = new Vector2D { X = 1, Y = 2 };
     Assert.IsTrue(vector2D1 == vector2D2);
     Assert.AreEqual(1, vector2D1.X);
     Assert.AreEqual(2, vector2D1.Y);
     Assert.AreEqual(1, vector2D2.X);
     Assert.AreEqual(2, vector2D2.Y);
 }
예제 #30
0
        public void Simple()
        {
            var vector = new Vector2D(8, 3);

            var actual = vector.ToArray();

            Assert.AreEqual(2, actual.Length);
            Assert.AreEqual(8, actual[0]);
            Assert.AreEqual(3, actual[1]);
        }