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); }
// 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"])); }
public SaveToSqlProcessorViaDapperTests() { DapperInitializer.InitDapper(); }
public DapperProcessingFactory(IConfiguration configuration) { _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); DapperInitializer.InitDapper(); }