Cantagallo/Cantagallo/Test/UnitTestPlayer.cs
/// <summary>
/// this method tests player's transformation, with proxy
/// </summary>
/// <seealso cref="IPlayerPowerUp"/>
this method tests player's transformation, with proxy
this method tests player ' s transformation with proxy
[Fact]
        public void PlayerPowerUpProxyTest()
        {
            IPlayer player = new PlayerImpl();
            IPlayerPowerUp powerUp = new PlayerPowerUpProxy(player);
            int speed = 650;
            int health = 15;
            int maxJumps = 5;
            int randomValue = 123;
            Assert.Equal(PlayerColor.Blue, player.PColor);
            powerUp.Transformation(PlayerColor.Red, speed, health, maxJumps);
            Assert.Equal(PlayerColor.Red, player.PColor);
            Assert.Equal(speed, player.Speed);
            Assert.Equal(health, player.MaxHealth);
            Assert.Equal(maxJumps, player.MaxJumps);
            powerUp.Transformation(PlayerColor.Red, randomValue, randomValue, randomValue);
            Assert.True(player.Speed != randomValue);
            Assert.Equal(PlayerColor.Red, player.PColor);
            Assert.Equal(speed, player.Speed);
            Assert.Equal(health, player.MaxHealth);
            Assert.Equal(maxJumps, player.MaxJumps);
        }
[ Fact ] public void PlayerPowerUpProxyTest ( ) { IPlayer player = new PlayerImpl ( ) ; IPlayerPowerUp powerUp = new PlayerPowerUpProxy ( player ) ; int speed = 650 ; int health = 15 ; int maxJumps = 5 ; int randomValue = 123 ; Assert . Equal ( PlayerColor . Blue , player . PColor ) ; powerUp . Transformation ( PlayerColor . Red , speed , health , maxJumps ) ; Assert . Equal ( PlayerColor . Red , player . PColor ) ; Assert . Equal ( speed , player . Speed ) ; Assert . Equal ( health , player . MaxHealth ) ; Assert . Equal ( maxJumps , player . MaxJumps ) ; powerUp . Transformation ( PlayerColor . Red , randomValue , randomValue , randomValue ) ; Assert . True ( player . Speed != randomValue ) ; Assert . Equal ( PlayerColor . Red , player . PColor ) ; Assert . Equal ( speed , player . Speed ) ; Assert . Equal ( health , player . MaxHealth ) ; Assert . Equal ( maxJumps , player . MaxJumps ) ; }
this method tests player's transformation, with proxy
this method tests player ' s transformation with proxy
seealso
None