testing db update
parent
cb592c6b5d
commit
27480c0290
@ -0,0 +1,35 @@
|
|||||||
|
using Xunit;
|
||||||
|
using Xunit.Abstractions;
|
||||||
|
|
||||||
|
namespace test.Mandatory
|
||||||
|
{
|
||||||
|
[Collection("EMaillingTeststCollection")]
|
||||||
|
[Trait("regres", "no")]
|
||||||
|
[Trait("dev", "wip")]
|
||||||
|
public class Database: IClassFixture<ServerSideFixture>
|
||||||
|
{
|
||||||
|
ServerSideFixture _serverFixture;
|
||||||
|
ITestOutputHelper output;
|
||||||
|
public Database(ServerSideFixture serverFixture, ITestOutputHelper output)
|
||||||
|
{
|
||||||
|
this.output = output;
|
||||||
|
_serverFixture = serverFixture;
|
||||||
|
|
||||||
|
output.WriteLine($"Startup.TestDbSettings.Database was {Startup.TestDbSettings.Database}");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Assuming we're using an account that may create databases,
|
||||||
|
/// Install all our migrations in a fresh new database.
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void InstallFromScratchUsingPoweredNpgsqlUser()
|
||||||
|
{
|
||||||
|
if (_serverFixture.DbCreated)
|
||||||
|
_serverFixture.DropTestDb();
|
||||||
|
|
||||||
|
_serverFixture.CreateTestDb();
|
||||||
|
_serverFixture.UpgradeDb();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
namespace test.Settings
|
||||||
|
{
|
||||||
|
public abstract class DbConnectionSettings
|
||||||
|
{
|
||||||
|
public string Database { get; set; }
|
||||||
|
public string Server { get; set; }
|
||||||
|
public int Port { get; set; }
|
||||||
|
public string Username { get; set; }
|
||||||
|
|
||||||
|
public string ConnectionString => $"Database={Database};Server={Server};Port={Port};Username={Username};Password={Password};";
|
||||||
|
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DevConnectionSettings : DbConnectionSettings
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public class TestConnectionSettings : DbConnectionSettings
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue