Cantagallo/Cantagallo/Test/UnitTestPlayer.cs
/// <summary>
/// this method tests player's speed with strategy 
/// </summary>
/// <seealso cref="IPlayerSpeedStrategy"/>
this method tests player's speed with strategy
this method tests player ' s speed with strategy
[Fact]
        public void PlayerSpeedStrategyTest()
        {
            IPlayer player = new PlayerImpl();
            IPlayerSpeedStrategy playerSpeed = new PlayerSpeed(player);
            Assert.True(player.Speed == playerSpeed.Velocity);
            player.Speed = 10;
            playerSpeed = new PlayerSpeed(player);
            Assert.Equal(player.Speed, playerSpeed.Velocity);
            playerSpeed = new PlayerSpeedTurnsAround();
            Assert.Equal(0, playerSpeed.Velocity);
        }
[ Fact ] public void PlayerSpeedStrategyTest ( ) { IPlayer player = new PlayerImpl ( ) ; IPlayerSpeedStrategy playerSpeed = new PlayerSpeed ( player ) ; Assert . True ( player . Speed == playerSpeed . Velocity ) ; player . Speed = 10 ; playerSpeed = new PlayerSpeed ( player ) ; Assert . Equal ( player . Speed , playerSpeed . Velocity ) ; playerSpeed = new PlayerSpeedTurnsAround ( ) ; Assert . Equal ( 0 , playerSpeed . Velocity ) ; }
this method tests player's speed with strategy
this method tests player ' s speed with strategy
seealso
None