示例#1
0
        public void GetHerdTest()
        {
            AnimalGroupName myGroup = new AnimalGroupName();

            Assert.AreEqual("Crash", myGroup.GetHerd("Rhino"));
            Assert.AreEqual("unknown", myGroup.GetHerd(""));
        }
示例#2
0
        public void GetHerdTest()
        {
            // * Rhino -> Crash
            AnimalGroupName myGroup = new AnimalGroupName();

            Assert.AreEqual("Crash", myGroup.GetHerd("Rhino"));
            Assert.AreEqual("unknown", myGroup.GetHerd("Cat"));
            Assert.AreEqual("unknown", myGroup.GetHerd(null));
        }
示例#3
0
        public void TestAnimalGroupNames()
        {
            AnimalGroupName animal = new AnimalGroupName();

            string[] animalNames = { "rhino", "giraffe", "elephant" };

            Assert.AreEqual("Crash", animal.GetHerd(animalNames[0]));
            Assert.AreEqual("Tower", animal.GetHerd(animalNames[1]));
            Assert.AreEqual("Herd", animal.GetHerd(animalNames[2]));
        }
示例#4
0
        public void TestAnimalGroupNamesForUnknown()
        {
            AnimalGroupName animal = new AnimalGroupName();

            string[] animalNames = { "RhiN", "gaffE", "Elepnt" };

            Assert.AreEqual("unknown", animal.GetHerd(animalNames[0]));
            Assert.AreEqual("unknown", animal.GetHerd(animalNames[1]));
            Assert.AreEqual("unknown", animal.GetHerd(animalNames[2]));
        }
示例#5
0
        public void TestAninmalGroupNamesCapitalization()
        {
            AnimalGroupName animal = new AnimalGroupName();

            string[] animalNames = { "rHiNo", "gIraFfE", "ElePhant" };

            Assert.AreEqual("Crash", animal.GetHerd(animalNames[0]));
            Assert.AreEqual("Tower", animal.GetHerd(animalNames[1]));
            Assert.AreEqual("Herd", animal.GetHerd(animalNames[2]));
        }
示例#6
0
        public void DoesGetHerdCallTheRightValueWhenTheKeyIsPassedIn()
        {
            //----Arrangle----------------------------------------
            AnimalGroupName testAnimal = new AnimalGroupName();


            //----Act-----------------------------------------------
            string testKey1 = testAnimal.GetHerd("rhino");
            string testKey2 = testAnimal.GetHerd("");
            string testKey3 = testAnimal.GetHerd("walrus");
            string testKey4 = testAnimal.GetHerd("Rhino");
            string testKey5 = testAnimal.GetHerd("elephants");
            string testKey6 = testAnimal.GetHerd("ELePhaNt");
            string testKey7 = testAnimal.GetHerd("gir affe");
            string testKey8 = testAnimal.GetHerd("CROW");
            string testKey9 = testAnimal.GetHerd("dogdog");


            //----Assert-------------------------------------------

            Assert.AreEqual("Crash", testKey1);
            Assert.AreEqual("unknown", testKey2);
            Assert.AreEqual("unknown", testKey3);
            Assert.AreEqual("Crash", testKey4);
            Assert.AreEqual("unknown", testKey5);
            Assert.AreEqual("Herd", testKey6);
            Assert.AreEqual("unknown", testKey7);
            Assert.AreEqual("Murder", testKey8);
            Assert.AreEqual("unknown", testKey9);
        }
        public void ProvideUnknownAnimalName_ExpectUnknownHerdName()
        {
            //Arrange
            AnimalGroupName animalGroup = new AnimalGroupName();

            //Act
            string herdName  = animalGroup.GetHerd("");
            string herdName2 = animalGroup.GetHerd("elephants");

            //Assert
            Assert.AreEqual("unknown", herdName);
            Assert.AreEqual("unknown", herdName2);
        }
        public void IsAnimalGroupNameCaseIndependant()
        {
            //arrange
            AnimalGroupName animals = new AnimalGroupName();

            //act
            string elephantHerdCapital = animals.GetHerd("ELEPHANT");
            string elephantHerdLower   = animals.GetHerd("elephant");

            //assert
            Assert.AreEqual("Herd", elephantHerdCapital);
            Assert.AreEqual("Herd", elephantHerdLower);
        }
示例#9
0
 public void AnimalGroupName()
 {
     Assert.AreEqual("Crash", _animalGroupName.GetHerd("rhino"));
     Assert.AreEqual("Tower", _animalGroupName.GetHerd("giraffe"));
     Assert.AreEqual("Herd", _animalGroupName.GetHerd("elephant"));
     Assert.AreEqual("Pride", _animalGroupName.GetHerd("lion"));
     Assert.AreEqual("Murder", _animalGroupName.GetHerd("crow"));
     Assert.AreEqual("Kit", _animalGroupName.GetHerd("pigeon"));
     Assert.AreEqual("Pat", _animalGroupName.GetHerd("flamingo"));
     Assert.AreEqual("Herd", _animalGroupName.GetHerd("deer"));
     Assert.AreEqual("Pack", _animalGroupName.GetHerd("dog"));
     Assert.AreEqual("Float", _animalGroupName.GetHerd("crocodile"));
     //Assert.AreEqual("Float",   _animalGroupName.GetHerd("CROCODILE"));
 }
示例#10
0
        public void GetHerdRandomCase()
        {
            AnimalGroupName animal = new AnimalGroupName();
            string          result = animal.GetHerd("CrocoDILe");

            Assert.AreEqual("Float", result);
        }
示例#11
0
        public void GetHerdNull()
        {
            AnimalGroupName animal = new AnimalGroupName();
            string          result = animal.GetHerd(null);

            Assert.AreEqual("unknown", result);
        }
示例#12
0
        public void GetHerdLowerCaseTest()
        {
            AnimalGroupName animal = new AnimalGroupName();
            string          result = animal.GetHerd("crow");

            Assert.AreEqual("Murder", result);
        }
示例#13
0
        public void GetHerdInitialCapTest()
        {
            AnimalGroupName animal = new AnimalGroupName();
            string          result = animal.GetHerd("Giraffe");

            Assert.AreEqual("Tower", result);
        }
        public void TestAnimalWithUpperCaseArg()
        {
            AnimalGroupName animalGroup = new AnimalGroupName();
            string          result      = animalGroup.GetHerd("Crow");

            Assert.AreEqual("Murder", result);
        }
示例#15
0
        public void GetHerdTestProgrammer()
        {
            AnimalGroupName animalGroupName = new AnimalGroupName();
            string          result          = animalGroupName.GetHerd("programmer");

            Assert.AreEqual("unknown", result);
        }
        public void TestAnimalWithLowerCaseArg()
        {
            AnimalGroupName animalGroup = new AnimalGroupName();
            string          result      = animalGroup.GetHerd("elephant");

            Assert.AreEqual("Herd", result);
        }
        public void TestAnimalWithUknownAnimalArg()
        {
            AnimalGroupName animalGroup = new AnimalGroupName();
            string          result      = animalGroup.GetHerd("alligator");

            Assert.AreEqual("unknown", result);
        }
示例#18
0
        public void GetHerdTestNull()
        {
            AnimalGroupName name = new AnimalGroupName();
            string          herd = name.GetHerd(null);

            Assert.AreEqual("unknown", herd);
        }
        public void TestAnimalWithEmptyArg()
        {
            AnimalGroupName animalGroup = new AnimalGroupName();
            string          result      = animalGroup.GetHerd("");

            Assert.AreEqual("unknown", result);
        }
示例#20
0
        public void GetHerdTestCAPS()
        {
            AnimalGroupName name = new AnimalGroupName();
            string          herd = name.GetHerd("RHINO");

            Assert.AreEqual("Crash", herd);
        }
示例#21
0
        public void GetHerdTestDonkey()
        {
            AnimalGroupName name = new AnimalGroupName();
            string          herd = name.GetHerd("donkey");

            Assert.AreEqual("unknown", herd);
        }
示例#22
0
        public void AnimalNameNotFound()
        {
            AnimalGroupName animalGroup = new AnimalGroupName();        //arrange to access Object AnimalGroupName
            string          nameHerd    = animalGroup.GetHerd("zebra"); // action to produce string from "Get Herd" exercise

            Assert.AreEqual("unknown", nameHerd);                       //assertion to compare that string produced matches appropriate herd name, in this case, animal not found, unknown
        }
示例#23
0
        public void AnimalNameWithGroup()
        {
            AnimalGroupName animalGroup = new AnimalGroupName();       //arrange to access Object AnimalGroupName
            string          nameHerd    = animalGroup.GetHerd("crow"); // action to produce string from "Get Herd" exercise

            Assert.AreEqual("Murder", nameHerd);                       //assertion to compare that string produced matches appropriate herd name
        }
示例#24
0
        public void GetHerdAllCapsTest()
        {
            AnimalGroupName animal = new AnimalGroupName();
            string          result = animal.GetHerd("ELEPHANT");

            Assert.AreEqual("Herd", result);
        }
示例#25
0
        public void GetHerdTestDog()
        {
            AnimalGroupName animalGroupName = new AnimalGroupName();
            string          result          = animalGroupName.GetHerd("dog");

            Assert.AreEqual("Pack", result);
        }
示例#26
0
        public void GiveAnimalName_ReturnHerd()
        {
            AnimalGroupName animal = new AnimalGroupName();

            string herd = animal.GetHerd("rhino");

            Assert.AreEqual("Crash", herd);
        }
示例#27
0
        public void ReturnsUnknown()
        {
            AnimalGroupName animal = new AnimalGroupName();

            string herd = animal.GetHerd("");

            Assert.AreEqual("unknown", herd);
        }
示例#28
0
        public void CapitalLetters_ReturnHerd()
        {
            AnimalGroupName animal = new AnimalGroupName();

            string herd = animal.GetHerd("RhInO");

            Assert.AreEqual("Crash", herd);
        }
        public void CaptialTest()
        {
            AnimalGroupName animalGroupName = new AnimalGroupName();

            string actual = animalGroupName.GetHerd("RHINO");

            Assert.AreEqual("Crash", actual);
        }
        public void PluralTest()
        {
            AnimalGroupName animalGroupName = new AnimalGroupName();

            string actual = animalGroupName.GetHerd("elephants");

            Assert.AreEqual("unknown", actual);
        }