public void Init()
        {
            core         = new SimpleCore();
            core.Species = CreateSpeciesDataset();

            List <Ecoregions.IParameters> ecoregionParms = new List <Ecoregions.IParameters>();

            ecoregionParms.Add(new Ecoregions.Parameters("Ecoregion A", // Name
                                                         "ecoregion A", // Description
                                                         1,             // Map Code,
                                                         true));        // Is Active?
            ecoregionParms.Add(new Ecoregions.Parameters("Ecoregion D", // Name
                                                         "ecoregion D", // Description
                                                         2,             // Map Code,
                                                         true));        // Is Active?
            core.Ecoregions = new Ecoregions.Dataset(ecoregionParms);

            int A = core.Ecoregions[0].MapCode;
            int D = core.Ecoregions[1].MapCode;
            int i = -1;   // inactive ecoregion
            DataGrid <EcoregionCode> ecoregionGrid = new DataGrid <EcoregionCode>(
                Data.MakeEcoregionCodes(new int[, ] {
                //1 2
                { A, A },    // 1
                { A, A },    // 2

                { A, A },    // 3
                { A, D },    // 4

                { i, D },    // 5
                { D, i }     // 6
            }));

            landscape      = new Landscape(ecoregionGrid, blockSize);
            core.Landscape = landscape;

            core.Ecoregion = landscape.NewSiteVar <IEcoregion>();
            foreach (ActiveSite activeSite in landscape)
            {
                ushort mapCode = (ushort)(ecoregionGrid[activeSite.Location]);
                core.Ecoregion[activeSite] = core.Ecoregions.Find(mapCode);
            }

            //  Reproduction.Initialize method accesses the succession
            //  plug-in's via the age-cohort interfaces.  So to avoid an
            //  exception, we just create an empty landscape cohorts object.
            core.SuccessionCohorts = new AgeCohort.LandscapeCohorts(null);

            MockSuccession mockSuccessionPlugIn = new MockSuccession(core);

            expectedSpecies      = new List <ISpecies>(core.Species.Count);
            speciesThatReproduce = new List <ISpecies>(core.Species.Count);

            actualSpecies_SeedingAlg   = new List <ISpecies>(core.Species.Count);
            actualSpecies_AddNewCohort = new List <ISpecies>(core.Species.Count);
        }
        public void Disturbed()
        {
            SimpleCore core = new SimpleCore();

            core.Species           = new Species.Dataset(null);
            core.Landscape         = DisturbedSites.MixedLandscape;
            core.SuccessionCohorts = new MyCohorts();

            const int    successionTimestep = 10;
            MySuccession succession         = new MySuccession(successionTimestep);

            succession.Initialize(core);

            //  Assert that no sites are flagged as disturbed before Run()
            foreach (Site site in DisturbedSites.MixedLandscape.AllSites)
            {
                Assert.IsFalse(succession.Disturbed[site]);
            }

            foreach (Location location in DisturbedSites.Locations)
            {
                ActiveSite site = DisturbedSites.MixedLandscape[location];
                succession.Disturbed[site] = true;
            }

            core.CurrentTime = successionTimestep + 1;
            succession.Run();
            AssertAreEqual(DisturbedSites.Locations,
                           succession.SitesVisited.ToArray());

            //  Confirm that the Disturbed site variable has been reset at end
            //  of the Run() method.
            foreach (Site site in DisturbedSites.MixedLandscape.AllSites)
            {
                Assert.IsFalse(succession.Disturbed[site]);
            }
        }