Ejemplo n.º 1
0
        public void ClassMethodsCanDefineDifferentAccess()
        {
            var Joker = new Megalomaniac();

            // Uncomment the next line and make the assert pass:
            // Joker.MakePlan("Destroy Batman");

            Assert.AreEqual("Destroy Batman", Joker.Mission);
        }
Ejemplo n.º 2
0
        public void ClassMethodsCanDefineDifferentAccess()
        {
            var Joker = new Megalomaniac();

            // Uncomment the next line and make the asert pass:
            // Joker.MakePlan("Destroy Batman");

            Assert.AreEqual("Destroy Batman", Joker.Mission);

        }
Ejemplo n.º 3
0
        public void PublicMethodsCanChangeObjectState()
        {
            var Joker = new Megalomaniac();

            // Uncomment the next line and make the asert pass:
            // Joker.MakePlan("Destroy Batman");

            Assert.AreEqual("Destroy Batman", Joker.Mission);
            Assert.AreEqual("Steal the batmobile", Joker.RetrieveNextStepOfPlan());
        }
Ejemplo n.º 4
0
        public void PublicMethodsCanChangeObjectState()
        {
            var Joker = new Megalomaniac();

            // Uncomment the next line and make the asert pass:
            // Joker.MakePlan("Destroy Batman");

            Assert.AreEqual("Destroy Batman", Joker.Mission);
            Assert.AreEqual("Steal the batmobile", Joker.RetrieveNextStepOfPlan());

        }
Ejemplo n.º 5
0
        public void ClassTypesAreCopiedByReference()
        {
            var TheBrain = new Megalomaniac
            {
                Name = "The Brain",
                Henchman = "Pinky",
                Mission = "Try to take over the world."
            };
           
            var AnotherBrain = TheBrain;
            AnotherBrain.Mission = "The same thing we do every night";

            Assert.AreEqual(FILL_ME_IN, AnotherBrain.Mission);
        }
Ejemplo n.º 6
0
        public void ClassTypesAreCopiedByReference()
        {
            var TheBrain = new Megalomaniac
            {
                Name     = "The Brain",
                Henchman = "Pinky",
                Mission  = "Try to take over the world."
            };

            var AnotherBrain = TheBrain;

            AnotherBrain.Mission = "The same thing we do every night";

            Assert.AreEqual("[__object__]", AnotherBrain.Mission);
        }
Ejemplo n.º 7
0
        public void ClassesCanMaintainInternalState()
        {
            var Joker = new Megalomaniac();

            // Uncomment the next line and make the asert pass:
            // Joker.MakePlan("Destroy Batman");

            Assert.AreEqual("Destroy Batman", Joker.Mission);
            Assert.AreEqual("Steal the batmobile", Joker.RetrieveNextStepOfPlan());
            Assert.AreEqual("Drive batmobile to Central Park", Joker.RetrieveNextStepOfPlan());
            Assert.AreEqual("Cause accident involving catwoman", Joker.RetrieveNextStepOfPlan());
            Assert.AreEqual("Escape from Central Park", Joker.RetrieveNextStepOfPlan());
            Assert.AreEqual("Convince Batman he harmed Catwoman", Joker.RetrieveNextStepOfPlan());
            Assert.AreEqual("Get Batman to reveal his secret identity", Joker.RetrieveNextStepOfPlan());
            Assert.AreEqual("Put Bruce Wayne in Jail", Joker.RetrieveNextStepOfPlan());
        }
Ejemplo n.º 8
0
        public void ClassesCanMaintainInternalState()
        {
            var Joker = new Megalomaniac();

            // Uncomment the next line and make the asert pass:
            // Joker.MakePlan("Destroy Batman");

            Assert.AreEqual("Destroy Batman", Joker.Mission);
            Assert.AreEqual("Steal the batmobile", Joker.RetrieveNextStepOfPlan());
            Assert.AreEqual("Drive batmobile to Central Park", Joker.RetrieveNextStepOfPlan());
            Assert.AreEqual("Cause accident involving catwoman", Joker.RetrieveNextStepOfPlan());
            Assert.AreEqual("Escape from Central Park", Joker.RetrieveNextStepOfPlan());
            Assert.AreEqual("Convince Batman he harmed Catwoman", Joker.RetrieveNextStepOfPlan());
            Assert.AreEqual("Get Batman to reveal his secret identity", Joker.RetrieveNextStepOfPlan());
            Assert.AreEqual("Put Bruce Wayne in Jail", Joker.RetrieveNextStepOfPlan());

        }