Esempio n. 1
0
        public void SubclassesCanRedefineBehaviorThatIsNotVirtual()
        {
            ReallyYippyChihuahua suzie = new ReallyYippyChihuahua("Suzie");

            //Assert.AreEqual (FILL_ME_IN, suzie.Wag ());
            Assert.AreEqual("BUP BUP BUP!!!", suzie.Wag());
        }
Esempio n. 2
0
        public void NewingAMethodDoesNotChangeTheBaseBehavior()
        {
            //This is vital to understand. In Koan 6, you saw that the Wag
            //method did what we defined in our class. But what happens
            //when we do this?
            Chihuahua bennie = new ReallyYippyChihuahua("Bennie");
            Assert.Equal("Happy", bennie.Wag());

            //That's right. The behavior of the object is dependent solely
            //on who you are pretending to be. Unlike when you override a
            //virtual method. Remember this in your path to enlightenment.
        }
Esempio n. 3
0
        public void NewingAMethodDoesNotChangeTheBaseBehavior()
        {
            //This is vital to understand. In Koan 6, you saw that the Wag
            //method did what we defined in our class. But what happens
            //when we do this?
            Chihuahua bennie = new ReallyYippyChihuahua("Bennie");

            Assert.Equal("Happy", bennie.Wag());

            //That's right. The behavior of the object is dependent solely
            //on who you are pretending to be. Unlike when you override a
            //virtual method. Remember this in your path to enlightenment.
        }
Esempio n. 4
0
        public void NewingAMethodDoesNotChangeTheBaseBehavior()
        {
            // Això és crucial que ho entengueu. A la càpsula 6 heu vist
            // que el mètode "Wag" feia el que havíem definit a la nostra
            // classe... Però que passa quan fem això?
            Chihuahua bennie = new ReallyYippyChihuahua("Bennie");

            Assert.AreEqual("Estic content i moc la cua!", bennie.Wag());

            // Així és. El comportament de l'objecte és dependent només
            // de qui preteneu ser (a diferència de quan sobreescrivim un
            // mètode virtual). Recordeu això en el vostre camí a la il·luminació.
        }
        public void NewingAMethodDoesNotChangeTheBaseBehavior()
        {
            //This is vital to understand. In Koan 6, you saw that the Wag
            //method did what we defined in our class. But what happens
            //when we do this?
            Chihuahua bennie = new ReallyYippyChihuahua("Bennie");
            Assert.Equal("Happy", bennie.Wag());

            // # so I guess that if the WAGWAGWAG wag method had been an override method,
            // # it would have stuck with the reallyYippyChihuahua even after
            // # it'd been downcast to a chihuahua. Since it was "born" (instantiated) with it?

            //That's right. The behavior of the object is dependent solely
            //on who you are pretending to be. Unlike when you override a
            //virtual method. Remember this in your path to enlightenment.
        }
Esempio n. 6
0
 public void SubclassesCanRedefineBehaviorThatIsNotVirtual()
 {
     ReallyYippyChihuahua suzie = new ReallyYippyChihuahua("Suzie");
     Assert.Equal("WAG WAG WAG!!", suzie.Wag());
 }
Esempio n. 7
0
        public void SubclassesCanRedefineBehaviorThatIsNotVirtual()
        {
            ReallyYippyChihuahua suzie = new ReallyYippyChihuahua("Suzie");

            Assert.Equal("WAG WAG WAG!!", suzie.Wag());
        }
Esempio n. 8
0
 public void SubclassesCanRedefineBehaviorThatIsNotVirtual()
 {
     ReallyYippyChihuahua suzie = new ReallyYippyChihuahua("Suzie");
     Assert.AreEqual(FILL_ME_IN, suzie.Wag());
 }
        public void AboutInheritanceSubclassesCanRedefineBehaviorThatIsNotVirtual()
        {
            ReallyYippyChihuahua suzie = new ReallyYippyChihuahua("Suzie");

            Assert.AreEqual(FILL_ME_IN, suzie.Wag());
        }