forked from slavaxom9k/PIBD-23_Fomichev_V.S._MagicCarpet
немного тестов
This commit is contained in:
@@ -15,5 +15,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\MagicCarpetContracts\MagicCarpetContracts.csproj" />
|
<ProjectReference Include="..\MagicCarpetContracts\MagicCarpetContracts.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<InternalsVisibleTo Include="MagicCarpetTests" />
|
||||||
|
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetTests.Infrastructure;
|
||||||
|
|
||||||
|
internal class ConfigurationDatabaseTest
|
||||||
|
{
|
||||||
|
public string ConnectionString =>
|
||||||
|
"Host=local;Port=5432;Database=MagicCarpetTest;Username=postgres;Password=postgres;";
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\MagicCarpetBusinessLogic\MagicCarpetBusinessLogic.csproj" />
|
<ProjectReference Include="..\MagicCarpetBusinessLogic\MagicCarpetBusinessLogic.csproj" />
|
||||||
<ProjectReference Include="..\MagicCarpetContracts\MagicCarpetContracts.csproj" />
|
<ProjectReference Include="..\MagicCarpetContracts\MagicCarpetContracts.csproj" />
|
||||||
|
<ProjectReference Include="..\MagicCarpetDatabase\MagicCarpetDatabase.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using MagicCarpetTests.Infrastructure;
|
||||||
|
using MagicCarpetDatabase;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetTests.StoragesContracts;
|
||||||
|
|
||||||
|
internal abstract class BaseStorageContractTest
|
||||||
|
{
|
||||||
|
protected MagicCarpetDbContext MagicCarpetDbContext { get; private set; }
|
||||||
|
|
||||||
|
[OneTimeSetUp]
|
||||||
|
public void OneTimeSetUp()
|
||||||
|
{
|
||||||
|
MagicCarpetDbContext = new MagicCarpetDbContext(new ConfigurationDatabaseTest());
|
||||||
|
|
||||||
|
MagicCarpetDbContext.Database.EnsureDeleted();
|
||||||
|
MagicCarpetDbContext.Database.EnsureCreated();
|
||||||
|
}
|
||||||
|
|
||||||
|
[OneTimeTearDown]
|
||||||
|
public void OneTimeTearDown()
|
||||||
|
{
|
||||||
|
MagicCarpetDbContext.Database.EnsureDeleted();
|
||||||
|
MagicCarpetDbContext.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user