public void TestReflection135Direction() { //Preconfig Vector position = new Vector(100f, 100f); Vector ballPos = new Vector(140f, 120f); int radius = 20; Vector ballSpeed = new Vector(-100, -100); Vector hitPoint = new Vector(120 + 14.1421f, 120 + 14.1421f); Vector expectedReflection = -ballSpeed; expectedReflection.Normalize(); Vector reflection; //Creation Bumper parent = new Bumper(); BoundingCircle bC2 = new BoundingCircle(radius, position); BoundingContainer bCont = new BoundingContainer(parent); bCont.AddBoundingBox(bC2); //Operation parent.Location = (new Vector(0, 0)); reflection = bC2.Reflect(ballSpeed, hitPoint, ballPos); reflection.Normalize(); //Assertion Assert.AreEqual(expectedReflection.X, reflection.X, 0.001f); Assert.AreEqual(expectedReflection.Y, reflection.Y, 0.001f); }