コード例 #1
0
        public void GetPoweredUpDataTest()
        {
            PoweredUpData powerups  = new PoweredUpData();
            Ball          testBall  = Ball.CreateBall(0, BallType.Normal, new Vector2(0, 0), GameData.DefaultBallSpeed, Vector2.RandomInUnitCircle(), GameData.DefaultBallSize);
            BallDecorator decorator = new BallDecorator(testBall);

            decorator.ApplyPowerup(powerups);
            Assert.IsNotNull(decorator.GetPoweredUpData());
        }
コード例 #2
0
        public void ApplyPowerupTest()
        {
            PoweredUpData powerups = new PoweredUpData();

            powerups.GivePlayerLife = true;
            Ball          testBall  = Ball.CreateBall(0, BallType.Normal, new Vector2(0, 0), GameData.DefaultBallSpeed, Vector2.RandomInUnitCircle(), GameData.DefaultBallSize);
            BallDecorator decorator = new BallDecorator(testBall);

            decorator.ApplyPowerup(powerups);
            Assert.AreEqual(powerups.GivePlayerLife, decorator.GetPoweredUpData().GivePlayerLife);
        }