public void CreateSol(TestStellarMap map)
        {
            Star sol = new Star("Sol");

            map.Add <Star>(sol);
            sol.Add(new Planet("Mercury"));
            sol.Add(new Planet("Venus"));

            Planet earth = new Planet("Earth");

            map.Add <Planet>(earth);

            Satellite moon = new Satellite("Moon");

            earth.Add(moon);

            sol.Add(new Planet("Mars"));
            sol.Add(new Planet("Jupiter"));
            sol.Add(new Planet("Saturn"));
            sol.Add(new Planet("Uranus"));
            sol.Add(new Planet("Neptune"));

            sol.Add(new DwarfPlanet("Ceres"));
            sol.Add(new DwarfPlanet("Pluto"));

            sol.Add(new Asteroid("Pallas"));
            sol.Add(new Asteroid("Juno"));

            sol.Add(new Comet("Haley's"));
            sol.Add(new Comet("Caeser's"));
        }
示例#2
0
        public void StellarMapNotEqualProxCentCTest()
        {
            TestStellarMap map = new TestStellarMap("TestMap");
            Star           sol = new Star("Sol");

            map.Add <Star>(sol);
            sol.Add(new Planet("Mercury"));
            sol.Add(new Planet("Venus"));
            sol.Add(new Planet("Earth"));
            sol.Add(new Planet("Mars"));
            sol.Add(new Planet("Jupiter"));
            sol.Add(new Planet("Saturn"));
            sol.Add(new Planet("Uranus"));
            sol.Add(new Planet("Neptune"));

            sol.Add(new DwarfPlanet("Ceres"));
            sol.Add(new DwarfPlanet("Pluto"));

            sol.Add(new Asteroid("Pallas"));
            sol.Add(new Asteroid("Juno"));

            sol.Add(new Comet("Haley's"));
            sol.Add(new Comet("Caeser's"));

            Star proximaCent = new Star("Proxima Centauri");

            map.Add <Star>(proximaCent);
            proximaCent.Add(new Planet("b"));

            TestStellarMap map2 = new TestStellarMap("TestMap");
            Star           sol2 = new Star("Sol");

            map2.Add <Star>(sol2);
            sol2.Add(new Planet("Mercury"));
            sol2.Add(new Planet("Venus"));
            sol2.Add(new Planet("Earth"));
            sol2.Add(new Planet("Mars"));
            sol2.Add(new Planet("Jupiter"));
            sol2.Add(new Planet("Saturn"));
            sol2.Add(new Planet("Uranus"));
            sol2.Add(new Planet("Neptune"));

            sol2.Add(new DwarfPlanet("Ceres"));
            sol2.Add(new DwarfPlanet("Pluto"));

            sol2.Add(new Asteroid("Pallas"));
            sol2.Add(new Asteroid("Juno"));

            sol2.Add(new Comet("Haley's"));
            sol2.Add(new Comet("Caeser's"));

            proximaCent = new Star("Proxima Centauri");
            map2.Add <Star>(proximaCent);
            proximaCent.Add(new Planet("b"));
            proximaCent.Add(new Planet("c"));

            Assert.IsFalse(BaseStellarMapEqualityComparer.Comparer.Equals(map, map2));
        }
示例#3
0
        public void StarNotEqualCatalogueTest()
        {
            TestStellarMap map = new TestStellarMap();
            Star           sol = new Star("Sol");

            map.Add <Star>(sol);
            sol.BasicProperties.Add(Constants.PropertyNames.Designation, "Sol");
            sol.BasicProperties.Add(Constants.PropertyNames.StellarClass, "G2V");
            var catalogue = new Dictionary <string, string>();

            catalogue.Add("HabHyg", "0");
            catalogue.Add("Hip", "0");
            sol.Properties.AddGroup("Catalogue", catalogue);

            TestStellarMap map2 = new TestStellarMap();
            Star           sol2 = new Star("Sol");

            map2.Add <Star>(sol2);
            sol2.BasicProperties.Add(Constants.PropertyNames.Designation, "Sol");
            sol2.BasicProperties.Add(Constants.PropertyNames.StellarClass, "G2V");
            catalogue = new Dictionary <string, string>();
            catalogue.Add("HabHyg", "1");
            catalogue.Add("Hip", "1");
            sol2.Properties.AddGroup("Catalogue", catalogue);

            Assert.IsFalse(StarEqualityComparer.Comparer.Equals(sol, sol2));
        }
        public void CreateEarth(TestStellarMap map)
        {
            Planet earth = new Planet("Earth");

            map.Add <Planet>(earth);

            Satellite moon = new Satellite("Moon");

            earth.Add(moon);
        }
示例#5
0
        public void StarNotEqualSolarSystemMissingPlutoTest()
        {
            TestStellarMap map = new TestStellarMap();
            Star           sol = new Star("Sol");

            map.Add <Star>(sol);
            sol.Add(new Planet("Mercury"));
            sol.Add(new Planet("Venus"));
            sol.Add(new Planet("Earth"));
            sol.Add(new Planet("Mars"));
            sol.Add(new Planet("Jupiter"));
            sol.Add(new Planet("Saturn"));
            sol.Add(new Planet("Uranus"));
            sol.Add(new Planet("Neptune"));

            sol.Add(new DwarfPlanet("Ceres"));
            sol.Add(new DwarfPlanet("Pluto"));

            sol.Add(new Asteroid("Pallas"));
            sol.Add(new Asteroid("Juno"));

            sol.Add(new Comet("Haley's"));
            sol.Add(new Comet("Caeser's"));

            TestStellarMap map2 = new TestStellarMap();
            Star           sol2 = new Star("Sol");

            //sol2.Identifier = sol.Identifier; // have to do this since BaseStellarMap's default identifier generation is GUIDs which can't be compared
            map2.Add <Star>(sol2);
            sol2.Add(new Planet("Mercury"));
            sol2.Add(new Planet("Venus"));
            sol2.Add(new Planet("Earth"));
            sol2.Add(new Planet("Mars"));
            sol2.Add(new Planet("Jupiter"));
            sol2.Add(new Planet("Saturn"));
            sol2.Add(new Planet("Uranus"));
            sol2.Add(new Planet("Neptune"));

            // Pluto is a planet once again
            sol2.Add(new Planet("Pluto"));

            // Ceres is back to an asteroid
            sol2.Add(new Asteroid("Ceres"));
            sol2.Add(new Asteroid("Pallas"));
            sol2.Add(new Asteroid("Juno"));

            sol2.Add(new Comet("Haley's"));
            sol2.Add(new Comet("Caeser's"));

            Assert.IsFalse(StarEqualityComparer.Comparer.Equals(sol, sol2));
        }
示例#6
0
        public void PlanetReferenceEqualTest()
        {
            TestStellarMap map = new TestStellarMap();

            Planet earth = new Planet("Earth");

            map.Add <Planet>(earth);

            Satellite moon = new Satellite("Moon");

            earth.Add(moon);

            Assert.IsTrue(PlanetEqualityComparer.Comparer.Equals(earth, earth));
        }
示例#7
0
        public void StarEqualSolarSystemTest()
        {
            TestStellarMap map = new TestStellarMap();
            Star           sol = new Star("Sol");

            map.Add <Star>(sol);
            sol.Add(new Planet("Mercury"));
            sol.Add(new Planet("Venus"));
            sol.Add(new Planet("Earth"));
            sol.Add(new Planet("Mars"));
            sol.Add(new Planet("Jupiter"));
            sol.Add(new Planet("Saturn"));
            sol.Add(new Planet("Uranus"));
            sol.Add(new Planet("Neptune"));

            sol.Add(new DwarfPlanet("Ceres"));
            sol.Add(new DwarfPlanet("Pluto"));

            sol.Add(new Asteroid("Pallas"));
            sol.Add(new Asteroid("Juno"));

            sol.Add(new Comet("Haley's"));
            sol.Add(new Comet("Caeser's"));

            TestStellarMap map2 = new TestStellarMap();
            Star           sol2 = new Star("Sol");

            map2.Add <Star>(sol2);
            sol2.Add(new Planet("Mercury"));
            sol2.Add(new Planet("Venus"));
            sol2.Add(new Planet("Earth"));
            sol2.Add(new Planet("Mars"));
            sol2.Add(new Planet("Jupiter"));
            sol2.Add(new Planet("Saturn"));
            sol2.Add(new Planet("Uranus"));
            sol2.Add(new Planet("Neptune"));

            sol2.Add(new DwarfPlanet("Ceres"));
            sol2.Add(new DwarfPlanet("Pluto"));

            sol2.Add(new Asteroid("Pallas"));
            sol2.Add(new Asteroid("Juno"));

            sol2.Add(new Comet("Haley's"));
            sol2.Add(new Comet("Caeser's"));

            Assert.IsTrue(StarEqualityComparer.Comparer.Equals(sol, sol2));
        }
示例#8
0
        public void PlanetNotEqualMoonMissingTest()
        {
            TestStellarMap map   = new TestStellarMap();
            Planet         earth = new Planet("Earth");

            map.Add <Planet>(earth);

            TestStellarMap map2   = new TestStellarMap();
            Planet         earth2 = new Planet("Earth");

            map2.Add <Planet>(earth2);
            Satellite moon2 = new Satellite("Moon");

            earth2.Add(moon2);

            Assert.IsFalse(PlanetEqualityComparer.Comparer.Equals(earth, earth2));
        }
示例#9
0
        public void PlanetNotEqualMissingPropertyTest()
        {
            TestStellarMap map   = new TestStellarMap();
            Planet         earth = new Planet("Earth");

            map.Add <Planet>(earth);
            Satellite moon = new Satellite("Moon");

            earth.Add(moon);

            BaseStellarMap map2   = new BaseStellarMap();
            Planet         earth2 = new Planet("Earth");

            map2.Add <Planet>(earth2);
            earth2.BasicProperties.Add("Description", "No signs of intelligent life");
            Satellite moon2 = new Satellite("Moon");

            earth2.Add(moon2);

            Assert.IsFalse(PlanetEqualityComparer.Comparer.Equals(earth, earth2));
        }