コード例 #1
0
        public void model_duck_cannot_fly_then_add_rocket()
        {
            Duck model = new ModelDuck();
            Assert.AreEqual("I can't fly.", model.PerformFly());

            model.SetFlyBehaviour(new FlyRocketPowered());
            Assert.AreEqual("I'm flying with a rocket!", model.PerformFly());
        }
コード例 #2
0
 public void model_duck_can_quack()
 {
     Duck model = new ModelDuck();
     Assert.AreEqual("Quack", model.PerformQuack());
 }
コード例 #3
0
 public void model_duck_cannot_fly()
 {
     Duck model = new ModelDuck();
     Assert.AreEqual("I can't fly.", model.PerformFly());
 }
コード例 #4
0
 public void duck_is_a_model_duck()
 {
     Duck model = new ModelDuck();
     Assert.AreEqual("I'm a model duck", model.Display());
 }