コード例 #1
0
        public void WoodenDuckDrawTest()
        {
            Duck duck = new WoodenDuck();

            var actual   = duck.Draw();
            var expected = "drawn wooden duck";

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void WoodenDuckQuackTest()
        {
            Duck duck = new WoodenDuck();

            var actual   = duck.Quack();
            var expected = "mute";

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void WoodenDuckFlyTest()
        {
            Duck duck = new WoodenDuck();

            var actual   = duck.Fly();
            var expected = "cannot fly";

            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void WoodenDuckFlyByRocketTest()
        {
            Duck duck = new WoodenDuck();

            var actual   = duck.Fly();
            var expected = "cannot fly";

            Console.WriteLine(actual);
            Assert.AreEqual(expected, actual);

            duck.SetFlyBehaviour(new RocketFlyBehaviour());
            actual   = duck.Fly();
            expected = "rocket powered fly";
            Console.WriteLine(actual);
            Assert.AreEqual(expected, actual);
        }