예제 #1
0
        public void ItNeedsAName_AndSouldBeObligatory()
        {
            var name = "Mr. Jumps";
            IMagical rabbit = new Rabbit(name);

            Assert.AreEqual(name, rabbit.Name);
        }
예제 #2
0
        public void WhenTwoRabbitsHasTheSameNames_TheyShouldBeEquals()
        {
            string name = "Joker";
            IMagical rabbit = new Rabbit(name);
            IMagical anotherRabbit = new Rabbit(name);

            Assert.AreEqual(rabbit, anotherRabbit);
        }
예제 #3
0
        public void WhenTwoRabbitsHasDifferentNames_TheyShouldBeNotEquals()
        {
            string name = "Mr. Jumps";
            Rabbit rabbit = new Rabbit(name);
            Rabbit anotheRabbit = new Rabbit(name+" 2");

            Assert.AreNotEqual(rabbit, anotheRabbit);
        }
예제 #4
0
        public void CanPutACardAndARabbit_ThenCanGetTheTwo()
        {
            IMagical aCard = new Card("Joker");
            IMagical aRabbit = new Rabbit("Mr. Jumps");

            _simpleHat.PutIn(aCard);
            _simpleHat.PutIn(aRabbit);

            List<IMagical> magicals = new List<IMagical>();
            magicals.Add(_simpleHat.Shazaam());
            magicals.Add(_simpleHat.Shazaam());

            if (!(magicals.Contains(aCard) && magicals.Contains(aRabbit)))
                Assert.Fail();
        }
예제 #5
0
 public void WhenPassingNull_RabbitFailFast()
 {
     IMagical rabbit = new Rabbit(null);
 }
예제 #6
0
 public void CanSaveARabbitInIt_AndRetriveIt()
 {
     IMagical aRabbit = new Rabbit("Mr. Jumps");
     _simpleHat.PutIn(aRabbit);
     Assert.AreSame(aRabbit, _simpleHat.Shazaam());
 }