Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();

            services.AddDbContext <StorageDbContext>(options =>
                                                     options.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));

            services.AddScoped <StorageService, StorageService>();

            RepoRequest.SetClient(Configuration["GatewayHost"], int.Parse(Configuration["GatewayPort"]));

            services.AddSwaggerGen(options =>
            {
                options.SwaggerDoc("v1", new OpenApiInfo
                {
                    Title       = "REAL.NET Storage API",
                    Version     = "v1",
                    Description = "Web API to store saves of REAL.NET Repository",
                });

                var basePath = AppContext.BaseDirectory;

                //Set the comments path for the swagger json and ui.
                var xmlPath = Path.Combine(basePath, "Storage.xml");
                options.IncludeXmlComments(xmlPath);
            });
        }
Ejemplo n.º 2
0
        public void LoadModelTest()
        {
            RepoRequest.SetClient("localhost", 8000);
            var model = new RepoLoader().LoadModel("AirSimModel");

            Assert.AreEqual("AirSimModel", model.Name);
            Assert.AreEqual(19, model.Elements.Count());
        }
Ejemplo n.º 3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            RepoRequest.SetClient(Configuration["GatewayHost"], int.Parse(Configuration["GatewayPort"]));

            services.AddControllers();

            services.AddSwaggerGen(options =>
            {
                options.SwaggerDoc("v1", new OpenApiInfo
                {
                    Title       = "REAL.NET Storage API",
                    Version     = "v1",
                    Description = "Web API to generate artifacts of REAL.NET",
                });

                var basePath = AppContext.BaseDirectory;

                //Set the comments path for the swagger json and ui.
                var xmlPath = Path.Combine(basePath, "Generator.xml");
                options.IncludeXmlComments(xmlPath);
            });
        }