public void Setup()
 {
     _sut = new RocketLandingService();
     _sut.SetupLandingArea(new LandingArea(new List <LandingPlatform>()
     {
         new LandingPlatform(new Square(10, 10, new Position(5, 5)))
     }, 100, 100));
 }
        public RocketLandingController(IRocketLandingService rocketLandingService, IConfiguration configuration)
        {
            _rocketLandingService = rocketLandingService;

            var settings = new LandingAreaSettings();

            configuration.GetSection("LandingAreaSettings").Bind(settings);
            rocketLandingService.SetupLandingArea(settings.ToLandingArea());
        }
        public void Setup()
        {
            _sut = new RocketLandingService();

            _sut.SetupLandingArea(new LandingArea(new List <LandingPlatform>()
            {
                new LandingPlatform(new Square(LandingPlatformHeight, LandingPlatformWidth, new Position(LandingPlatformTopLeftX, LandingPlatformTopLeftY)))
            }, LandingAreaHeight, LandingAreaWidth));
        }
Beispiel #4
0
        public Tests()
        {
            var serviceCollection = new ServiceCollection();

            serviceCollection.AddScoped <IRocketLandingService, RocketLandingService>();
            IConfiguration configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();

            serviceCollection.AddSingleton(configuration);
            _rocketLandingService = serviceCollection.BuildServiceProvider().GetService <IRocketLandingService>();
        }