Пример #1
0
        public void ArePlanetsAndSunAligned()
        {
            var star    = new Planet(0, 0);
            var planets = new List <Planet>
            {
                new Planet(90, 500),
                new Planet(90, 2000),
                new Planet(90, 1000)
            };
            var system = new StarSystem(star, planets);

            system.TranslateStep();

            var  calculator = new ForecastCalculator(system);
            bool result     = calculator.ArePlanetsAndSunAligned();

            Assert.IsTrue(result);
        }
Пример #2
0
        public void ArePlanetsAlignedButNotWithSunTest()
        {
            var star    = new Planet(0, 0);
            var planets = new List <Planet>
            {
                new Planet(-1, 500),
                new Planet(35, 1500),
                new Planet(27, 1000)
            };

            var system = new StarSystem(star, planets);

            system.TranslateStep();

            var  calculator = new ForecastCalculator(system);
            bool result     = calculator.ArePlanetsAligned();

            Assert.IsTrue(result);

            result = calculator.ArePlanetsAndSunAligned();
            Assert.IsFalse(result);
        }