Ejemplo n.º 1
0
        public SqlStorageViaDapperTests()
        {
            DapperInitializer.InitDapper();
            var configurationMock = new Mock <IConfiguration>();

            configurationMock.Setup(m => m.GetValue("connectionString"))
            .Returns("Server=127.0.0.1,1423;Database=Potestas;User Id=SA;Password=DOCKERTASK_1");

            _sqlStorage = new FlashObservationsSqlStorage(configurationMock.Object);
        }
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)
        {
            services.AddTransient <Potestas.Configuration.IConfiguration, Configuration.Configuration>();
            services.AddTransient <IEnergyObservationStorage <FlashObservation>, FlashObservationsSqlStorage>();
            services.AddTransient <IEnergyObservationAnalizer, SqlAnalyzer>();
            DapperInitializer.InitDapper();

            services.AddControllers();

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new OpenApiInfo {
                    Title = "Potestas API", Version = "v1"
                });
            });

            services.AddHealthChecks().AddCheck("PotestasDb", new SqlServerHealthCheck(Configuration["connectionString"]));
        }
Ejemplo n.º 3
0
 public SaveToSqlProcessorViaDapperTests()
 {
     DapperInitializer.InitDapper();
 }
Ejemplo n.º 4
0
 public DapperProcessingFactory(IConfiguration configuration)
 {
     _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
     DapperInitializer.InitDapper();
 }