Пример #1
0
        public void NormalWeatherTest()
        {
            var solarSystem = new SolarSystem(new List <Planet>()
            {
                new Planet(30, 30, 0, Planet.Direction.CLOCKWISE),
                new Planet(30, 150, 0, Planet.Direction.CLOCKWISE),
                new Planet(30, 90, 0, Planet.Direction.CLOCKWISE)
            });

            Assert.Equal(Weather.WeatherType.NORMAL, solarSystem.CalculateWeather().Type);
        }
Пример #2
0
        public void RainyWeatherTest()
        {
            var solarSystem = new SolarSystem(new List <Planet>()
            {
                new Planet(30, 30, 0, Planet.Direction.CLOCKWISE),
                new Planet(30, 150, 0, Planet.Direction.CLOCKWISE),
                new Planet(30, 260, 0, Planet.Direction.CLOCKWISE)
            });

            Assert.Equal(Weather.WeatherType.RAINY, solarSystem.CalculateWeather().Type);
        }
Пример #3
0
        public void DraughtWeatherTest()
        {
            var solarSystem = new SolarSystem(new List <Planet>()
            {
                new Planet(10, 30.000000001, 0, Planet.Direction.CLOCKWISE),
                new Planet(20, 30, 0, Planet.Direction.CLOCKWISE),
                new Planet(30, 30, 0, Planet.Direction.CLOCKWISE)
            });

            Assert.Equal(Weather.WeatherType.DRAUGHT, solarSystem.CalculateWeather().Type);
        }
Пример #4
0
        public void OptimumWeatherTest()
        {
            var p1          = new CartesianCoordinates(0, 1);
            var p2          = new CartesianCoordinates(1, 0);
            var p3          = new CartesianCoordinates(2, -1);
            var solarSystem = new SolarSystem(new List <Planet>()
            {
                new Planet(p1.ToPolar().Length, p1.ToPolar().Angle.ToDegrees(), 0, Planet.Direction.CLOCKWISE),
                new Planet(p2.ToPolar().Length, p2.ToPolar().Angle.ToDegrees(), 0, Planet.Direction.CLOCKWISE),
                new Planet(p3.ToPolar().Length, p3.ToPolar().Angle.ToDegrees(), 0, Planet.Direction.CLOCKWISE)
            });

            Assert.Equal(Weather.WeatherType.OPTIMUM, solarSystem.CalculateWeather().Type);
        }