Ejemplo n.º 1
0
        public void CreateCatWithName()
        {
            var name = "Cat";

            Cat c = new Cat(name);

            Assert.IsTrue(c.Name == name);
            Assert.IsTrue(c.IsHungry == true);
            Assert.IsTrue(c.Color == "grey");
            Assert.IsTrue(c.Peculiarities.Count == 0);
        }
Ejemplo n.º 2
0
        public void CreateCatWithEverythingButPeculiarities()
        {
            var name = "Cat";
            var color = "black";
            var age = 5;

            Cat c = new Cat(color, age, name);

            Assert.IsTrue(c.Name == name);
            Assert.IsTrue(c.IsHungry == true);
            Assert.IsTrue(c.Color == color);
            Assert.IsTrue(c.Age == age);
            Assert.IsTrue(c.Peculiarities.Count == 0);
        }
Ejemplo n.º 3
0
        public void CreateCatWithEverything()
        {
            var name = "Cat";
            var color = "black";
            var age = 5;
            var peculiarities = new List<string> { "a peculiarity" };

            Cat c = new Cat(color, age, name, peculiarities);

            Assert.IsTrue(c.Name == name);
            Assert.IsTrue(c.IsHungry == true);
            Assert.IsTrue(c.Color == color);
            Assert.IsTrue(c.Age == age);
            Assert.IsTrue(c.Peculiarities.Count == peculiarities.Count);
        }
Ejemplo n.º 4
0
        public void FeedHungryCatTest()
        {
            Cat c = new Cat("Cat");
            c.Feed();

            Assert.IsTrue(c.IsHungry == false);
        }