Exemplo n.º 1
0
        public void FindBestAvailableMagnetPoint_ShouldReturnItself_WhenNoMagnetPointIsInRadius()
        {

            var magnetoEffect = new MagnetoEffect(5);
            magnetoEffect.AddMagnetPoint(new Point(50, 50));

            var point = new Point(100, 50);
            Assert.AreEqual(point, magnetoEffect.FindBestAvailableMagnetPoint(point));
            
        }
Exemplo n.º 2
0
        public void FindBestAvailableMagnetPoint_ShouldReturnShortestDistance_WhenMoreThanOneMagnetPointsAreInRadius()
        {

            var magnetoEffect = new MagnetoEffect(5);
            magnetoEffect.AddMagnetPoint(new Point(50, 50));
            magnetoEffect.AddMagnetPoint(new Point(51, 51));

            var point = new Point(51, 52);
            Assert.AreEqual(new Point(51, 51), magnetoEffect.FindBestAvailableMagnetPoint(point));
            
        }
Exemplo n.º 3
0
        public void FindBestAvailableMagnetPoint_ShouldReturnShortestDistance_WhenOneMagnetPointsIsInRadius()
        {

            var magnetoEffect = new MagnetoEffect(5);
            magnetoEffect.AddMagnetPoint(new Point(50, 50));
            magnetoEffect.AddMagnetPoint(new Point(100, 50));

            var point = new Point(101, 48);
            Assert.AreEqual(new Point(100, 50), magnetoEffect.FindBestAvailableMagnetPoint(point));
            
        }