Exemple #1
0
        public void PlantDies()
        {
            ISoil  soil  = new Soil();
            IPlant plant = new IdentifiedSeed("Carrot", PlantType.Vegetable);

            plant.Plant(soil);
            plant = plant.Grow(); // Seedling
            plant = plant.Grow(); // Vegetative
            plant = plant.Grow(); // Flowering
            plant = plant.Grow(); // Harvestable
            plant = plant.Grow(); // Dead

            Assert.Equal(typeof(DeadPlant), plant.GetType());
        }
Exemple #2
0
        public void GrowPlantStages()
        {
            ISoil  soil  = new Soil();
            IPlant plant = new IdentifiedSeed("Carrot", PlantType.Vegetable);

            plant.Plant(soil);
            plant = plant.Grow(); // Seedling
            plant = plant.Grow(); // Vegetative
            plant = plant.Grow(); // Flowering
            plant = plant.Grow(); // Harvestable

            Debug.WriteLine($"GrowPlantStages: Plant Type: {plant.Name}");
            Assert.True(plant.IsHarvestable);
        }
Exemple #3
0
        public void HarvestPlant()
        {
            ISoil  soil  = new Soil();
            IPlant plant = new IdentifiedSeed("Carrot", PlantType.Vegetable);

            plant.Plant(soil);
            plant = plant.Grow(); // Seedling
            plant = plant.Grow(); // Vegetative
            plant = plant.Grow(); // Flowering
            plant = plant.Grow(); // Harvestable

            IHarvestable product = plant.Harvest();

            Assert.Equal(typeof(Vegetable), product.GetType());
        }
Exemple #4
0
        public void GrowIdentifiedSeed()
        {
            ISoil  soil  = new Soil();
            IPlant plant = new IdentifiedSeed("Carrot", PlantType.Vegetable);

            plant.Plant(soil);
            plant = plant.Grow();

            Assert.True(plant.IsGrowing);
        }