Exemplo n.º 1
0
        public void StarFactory_Create_With_Defaults()
        {
            var sf    = new StarFactory(MinAge, MaxAge);
            var stars = sf.Create("Sol");

            Assert.IsNotNull(stars);
            Assert.Less(0, stars.Count);
        }
Exemplo n.º 2
0
        public void StarFactory_Create_With_Override()
        {
            var sf    = new StarFactory(MinAge, MaxAge);
            var stars = sf.Create("Sol", 4);

            Assert.IsNotNull(stars);
            Assert.AreEqual(4, stars.Count);
        }
Exemplo n.º 3
0
    public static void Create(int _seed)
    {
        Random            random    = new Random(_seed);
        int               planets   = random.Next(3, 9);
        CelestialBodyData starData  = StarFactory.CreateData(ref random);
        Star              star      = StarFactory.Create(starData, null);
        float             minRadius = random.Next(20, 30);

        for (int i = 0; i < planets; i++)
        {
            CelestialBodyData planetData = PlanetFactory.CreateData(ref random, minRadius);
            minRadius = planetData.OrbitingRadius + 20;
            Planet planet = PlanetFactory.Create(planetData, star);
            PlanetLineFactory.CreateLine(planet.OrbitingRadius, planet.Parent.transform);
        }
    }
Exemplo n.º 4
0
        public void StarFactory_Create_With_No_Name_Throws()
        {
            var sf = new StarFactory(MinAge, MaxAge);

            sf.Create("");
        }