Test and Run DbSetup, succes

This commit is contained in:
Janus Knudsen 2025-01-22 17:30:10 +01:00
parent db09261768
commit 2e0b20a53e
8 changed files with 102 additions and 76 deletions

View file

@ -17,6 +17,7 @@
<ItemGroup>
<ProjectReference Include="..\Application\Application.csproj" />
<ProjectReference Include="..\Database\Database.csproj" />
</ItemGroup>
<ItemGroup>

View file

@ -19,8 +19,8 @@ namespace Tests
conn.ExecuteSql("SELECT 1 as p");
var sql = "SELECT * FROM swp.foo";
var customers = conn.Query(sql, commandType:CommandType.Text);
//var sql = "SELECT * FROM swp.foo";
//var customers = conn.Query(sql, commandType:CommandType.Text);
}
@ -30,9 +30,19 @@ namespace Tests
var conn = Container.Resolve<IDbConnection>();
}
[TestMethod]
public async Task TryDbSetup()
{
var conn = Container.Resolve<IDbConnection>();
var dbSetup = new Database.Identity.DbSetup(conn);
await dbSetup.CreateDatabase("swp");
}
[TestMethod]
public void MyTestMethod()
public void SetupPostgresql_LISTEN()
{
var builder = new ConfigurationBuilder()
.AddPostgresConfiguration(options =>

View file

@ -1,7 +1,7 @@
{
"AllowedHosts": "*",
"ConnectionStrings": {
"ptdb": "Host=192.168.1.57;Port=5432;Database=ptdb01;User Id=sathumper;Password=3911;"
"ptdb": "Host=192.168.1.57;Port=5432;Database=ptdb01;User Id=postgres;Password=3911;"
},
"ApplicationInsights": {
"ConnectionString": "InstrumentationKey=6d2e76ee-5343-4691-a5e3-81add43cb584;IngestionEndpoint=https://northeurope-0.in.applicationinsights.azure.com/"