Beispiel #1
0
        public void IdentifySeed()
        {
            SeedBank seedBank = new SeedBank();

            seedBank.Add("Carrot", PlantType.Vegetable);
            seedBank.Add("Dragonfruit", PlantType.Fruit);
            seedBank.Add("Squash", PlantType.Vegetable);

            ISeed seed            = new UnidentifiedSeed(seedBank);
            ISeed idenitifiedSeed = seedBank.Identify(seed);

            Assert.NotEqual(idenitifiedSeed?.GetType(), typeof(UnidentifiedSeed));
            Debug.WriteLine($"IdentifySeed: Identified Seed Type: {idenitifiedSeed.Name}");
        }
Beispiel #2
0
        public void GrowUnidentifiedSeed()
        {
            SeedBank seedBank = new SeedBank();

            seedBank.Add("Carrot", PlantType.Vegetable);
            seedBank.Add("Dragonfruit", PlantType.Fruit);
            seedBank.Add("Squash", PlantType.Vegetable);

            ISoil  soil  = new Soil();
            IPlant plant = new UnidentifiedSeed(seedBank);

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

            Debug.WriteLine($"GrowUnidentifiedSeed: Plant Type: {plant.Name}");
            Assert.True(plant.IsHarvestable);
        }