Exemple #1
0
        public void TwoIdenticalVectorReturnsSameHashCode()
        {
            Vector2 v1 = new Vector2(50, 80);
            Vector2 same = new Vector2(50, 80);

            Assert.AreEqual(v1.GetHashCode(), same.GetHashCode());
        }
Exemple #2
0
        public void TwoIdenticalVectorsAreEquals()
        {
            Vector2 v1 = new Vector2(50,80);
            Vector2 same = new Vector2(50,80);

            Assert.AreEqual(v1, same);
        }
Exemple #3
0
        public void SumOfTwoVectorsWorksCorrectly()
        {
            Vector2 v = new Vector2(10,5);

            Vector2 n = v + new Vector2(20, 50);
            Assert.IsTrue((n.X == 30 && n.Y == 55));
        }
Exemple #4
0
        public void NormalizeVectorWorksCorrectly()
        {
            Vector2 v = new Vector2(10,15);
            v = Vector2.Normalize(v);

            Assert.AreEqual(v.Length(), 1);
        }
Exemple #5
0
        public void MultipliacationOfTwoVectorsWorksCorrectly()
        {
            Vector2 v = new Vector2(10, 5);

            Vector2 n = v * new Vector2(20, 50);
            Assert.IsTrue((n.X == 200 && n.Y == 250));
        }
Exemple #6
0
 public static ClientPlayerModel CreateClientPlayerModel(string username, int sex, Vector2 position)
 {
     return new ClientPlayerModel() { Position = position, Sex = sex, UserName = username };
 }
Exemple #7
0
 public void CreateVectorParameters()
 {
     Vector2 v = new Vector2(10,15);
     Assert.AreEqual(v.X, 10);
     Assert.AreEqual(v.Y, 15);
 }
Exemple #8
0
 public void CreateVectorNoParametersSetXAndYToZero()
 {
     Vector2 v = new Vector2();
     Assert.AreEqual(v.X, 0);
     Assert.AreEqual(v.Y, 0);
 }