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); }
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); }
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); } }
public void StarFactory_Create_With_No_Name_Throws() { var sf = new StarFactory(MinAge, MaxAge); sf.Create(""); }