예제 #1
0
        public void InSummerGreenAndShapely()
        {
            //arrange
            Forest testForest = new Forest();
            testForest.AddTree(new FirTree());

            //act
            testForest.ChangeSeason();
            testForest.ChangeSeason();

            //assert
            Assert.AreEqual(TreeShape.Shapely, testForest.GetTree(TreeType.FirTree).Shape);
            Assert.AreEqual(TreeColor.Green, testForest.GetTree(TreeType.FirTree).Color);
        }
예제 #2
0
        public void ChangeSeasonOneYear()
        {
            //arrange
            Forest testForest = new Forest();
            testForest.AddTree(new FirTree());

            //act
            testForest.ChangeSeason();
            testForest.ChangeSeason();
            testForest.ChangeSeason();
            testForest.ChangeSeason();

            //assert
            Assert.AreEqual(Season.Winter, testForest.CurrentSeason);
            //Assert.AreEqual(TreeShape.Shapely , testForest.GetTree(TreeType.FirTree).Shape);
            //Assert.AreEqual(TreeColor.Green, testForest.GetTree(TreeType.FirTree).Color);
        }
예제 #3
0
        public void AllUseCase()
        {
            Forest testForest = new Forest();
            testForest.AddTree(new FirTree());

            Assert.AreEqual(1 , testForest.TreeCount);  // В лесу родилась
            Assert.AreEqual(TreeType.FirTree, testForest.GetTree(TreeType.FirTree).Type);  // ёлочка
            Assert.AreEqual(Season.Winter , testForest.CurrentSeason);  // Зимой
            Assert.AreEqual(TreeShape.Shapely, testForest.GetTree(TreeType.FirTree).Shape);  // стройная
            Assert.AreEqual(TreeColor.Green, testForest.GetTree(TreeType.FirTree).Color);  // зеленая была

            testForest.ChangeSeason();
            testForest.ChangeSeason();

            Assert.AreEqual(testForest.GetTree(TreeType.FirTree).GrowingSpeed * 2, testForest.GetTree(TreeType.FirTree).Height);  // В лесу она росла
            Assert.AreEqual(Season.Summer, testForest.CurrentSeason);  // и летом
            Assert.AreEqual(TreeShape.Shapely, testForest.GetTree(TreeType.FirTree).Shape);  // стройная
            Assert.AreEqual(TreeColor.Green, testForest.GetTree(TreeType.FirTree).Color);  // зеленая была
        }
예제 #4
0
        public void ChangeSeason()
        {
            //arrange
            Forest testForest = new Forest();
            testForest.AddTree(new FirTree());

            //act
            testForest.ChangeSeason();

            //assert
            Assert.AreEqual(Season.Spring , testForest.CurrentSeason);
        }