예제 #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);
        }
예제 #2
0
파일: Startup.cs 프로젝트: skowa/Potestas
        // 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"]));
        }
예제 #3
0
 public SaveToSqlProcessorViaDapperTests()
 {
     DapperInitializer.InitDapper();
 }
예제 #4
0
 public DapperProcessingFactory(IConfiguration configuration)
 {
     _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
     DapperInitializer.InitDapper();
 }