public void TestNextStep() { ObjectStrategy nextStep = new ObjectStrategy(); ObjectStrategy testStrategy = new ObjectStrategy(); testStrategy.NextStep = nextStep; Assert.AreEqual(nextStep, testStrategy.NextStep); }
public Kitty(PointF pos) { this.position.X = pos.X - 100; this.position.Y = pos.Y - 100; this.size = new SizeF(250, 200); strategy = new KittyLifeStrategy(this); }
public override bool move() { if (strategy == null) { strategy = NoOpKittyStrategy.INSTANCE; } if (strategy.isExecutable()) { return strategy.execute(); } return false; }