Ejemplo n.º 1
0
        public void CsvMissingFieldsTest()
        {
            var stream1 = GetCsvStream("01-22-2020.csv");

            Assert.NotNull(stream1);
            var records = CovidDataManager.GetRecords(new DateTime(2020, 1, 22), stream1);
        }
Ejemplo n.º 2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Configure Compression level
            services.Configure <GzipCompressionProviderOptions>(options => options.Level = CompressionLevel.Fastest);

            // Add Response compression services
            services.AddResponseCompression(options =>
            {
                options.Providers.Add <GzipCompressionProvider>();
                options.EnableForHttps = true;
            });

            services.AddCors(o => o.AddPolicy("MyPolicy", builder =>
            {
                builder.SetIsOriginAllowed(hostName => true)
                .AllowAnyMethod()
                .AllowAnyHeader()
                .AllowCredentials();        //.WithOrigins("http://localhost:4200", "https://localhost:4200")
            }));
            services.AddControllers();
            CovidDataManager manager = new CovidDataManager();

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new OpenApiInfo {
                    Title = "Covid-19 Data API 2020", Version = "v0.1"
                });
            });
        }