예제 #1
0
        public void Test1()
        {
            // ARRANGE:
            House h = new House(0, 0);

            h.AddSeedInPot(new Seed());
            h.AddSeedInPot(new Seed());
            // ACT:
            h.ResetHouse();
            // ASSERT:
            Assert.AreEqual(4, h.GetCount(), "Houses must be reset to 4 seeds each");
        }
예제 #2
0
        public void Test1()
        {
            // ARRANGE:
            House house = new House(0, 0);

            house.AddSeedInPot(new Seed());
            // ACT:
            house.ResetHouse();
            // ASSERT:
            Assert.AreEqual(4, house.GetCount(), "Initialised houses should contain 4 seeds");
        }
예제 #3
0
        public void Test1()
        {
            //ARRANGE
            House h    = new House(0, 0);
            Seed  seed = new Seed();

            h.AddSeedInPot(seed);
            //ACT
            h.ResetHouse();
            //ASSERT
            Assert.AreEqual(4, h.GetCount(), "Resetting the house should restore the House to 4 seeds in the pot");
        }
예제 #4
0
        public void checkingIfResetHouseWorks()
        {
            //ARRANGE:
            House h = new House(0, 0);

            //ACT:
            h.AddSeedInPot(new Seed()); // Adding one seed to test
            h.ResetHouse();

            //Assert
            Assert.AreEqual(4, h.GetCount(), "Restores house to initialized state");
        }
예제 #5
0
        public void WhenAddingSeedToHouseCountIsCorrect()
        {
            // ARRANGE:
            House h = new House(0, 0);

            // ACT:
            for (int i = 0; i < 16; i++)
            {
                h.AddSeedInPot(new Seed()); // <-- THIS IS THE METHOD WE ARE TESTING
            }
            // ASSERT:
            Assert.AreEqual(20, h.GetCount(), "Adding seeds to a pot increases the number of seeds in the pot.");
        }
예제 #6
0
        public void ResestingHouseMustHave4Seeds()
        {
            //ARRANGE:
            House h = new House(0, 0);

            for (int i = 0; i < 21; i++)
            {
                h.AddSeedInPot(new Seed());
            }
            // ACT
            h.ResetHouse();
            //ASSERT:
            Assert.AreEqual(4, h.GetCount(), "Houses that have been reset must have 4 seeds in them");
        }
예제 #7
0
        public void Test1()
        {
            // Arrange
            House h = new House(0, 0);

            for (int i = 0; i < 3; i++)
            {
                h.AddSeedInPot(new Seed());
            }
            // Act
            h.ResetHouse();
            // Assert
            Assert.AreEqual(4, h.GetCount(), "adding new seeds increases the pots new seed number");
        }
예제 #8
0
        public void TestResetHouse()
        {
            // ARRANGE:
            House h = new House(0, 0);//create a house

            for (int i = 0; i < 4; i++)
            {
                h.AddSeedInPot(new Seed());
            } //modify the house from its intial state
            // ACT:
            h.ResetHouse(); //call the method for testing
            // ASSERT:
            Assert.AreEqual(4, h.GetCount(), "Reset houses must have 4 seeds in them.");//should be returned to original state
        }
        public void ResetHouseRestoresHouseToTheSameState()
        {
            //ARRANGE
            House h = new House(0, 0);

            for (int i = 0; i < 16; i++)
            {
                h.AddSeedInPot(new Seed());
            }
            //ACT
            h.ResetHouse();
            //ASSERT
            Assert.AreEqual(4, h.GetCount());
        }
예제 #10
0
        public void WhenCallingResetHouseTheHouseIsReset()
        {
            //arrange
            House x = new House(0, 0);      //create a new house, seeds = 4

            x.AddSeedInPot(new Seed());     //add one seed to the house
                                            //no. of seeds is therefore 5

            //act
            x.ResetHouse();                 //reset the house (Method we are testing!)
            ////no. of seeds should be 4

            //assert
            Assert.AreEqual(x.GetCount(), new House(0, 0).GetCount());  //check against new initialised house
        }
예제 #11
0
        public void Test1()
        {
            // Arrange
            House h = new House(1, 2);

            for (int i = 0; i < 8; i++)
            {
                h.AddSeedInPot(new Seed());
            }
            // Act
            h.ResetHouse();
            // Assert
            Assert.AreEqual(4, h.GetCount(), "House should reset back to having 4 seeds.");
            //Assert.Pass();
        }
예제 #12
0
        public void Test1()
        {
            //Arrange
            House house = new House(0, 0);

            for (int i = 0; i < 7; i++)
            {
                house.AddSeedInPot();
            }

            //Act
            house.ResetHouse();

            //Assert
            Assert.AreEqual(house.seedsInHouse.Length, 4, "Test Failed");
        }
예제 #13
0
        public void Test1()
        {
            //ARRANGE:
            House h = new House(0, 0);

            for (int i = 0; i < 16; i++)
            {
                h.AddSeedInPot(new Seed());
            }
            //ACT:
            for (int i = 0; i < 16; i++)
            {
                h.ResetHouse(); // <-- THIS IS THE METHOD WE ARE TESTING
            }
            //ASSERT:
            Assert.AreEqual(4, h.GetCount(), "Restores the House to the same state that it was in just after it was initialized, with 4 seeds in the pot.");
        }
예제 #14
0
        public void WhenResetingHouseSeedCountIs0()
        {
            //ARRANGE
            House house = new House(0, 0);

            //adding seeds in pot
            for (int i = 0; i < 4; i++)
            {
                house.AddSeedInPot(new Seed());
            }

            //ACT
            house.ResetHouse();

            //ASSERT
            Assert.AreEqual(4, house.GetCount(), "ResetHouse method supposed to return house to initialization state with 4 seeds");
        }