Migrate UnitOfWorkTests

This commit is contained in:
Mole
2020-10-22 13:27:24 +02:00
parent 14c55177f3
commit 4f80ebd788
2 changed files with 7 additions and 8 deletions

View File

@@ -1,19 +1,19 @@
using System;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.Integration.Testing;
using Umbraco.Tests.Testing;
namespace Umbraco.Tests.Persistence
namespace Umbraco.Tests.Integration.Umbraco.Infrastructure.Persistence
{
[TestFixture]
[UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)]
public class UnitOfWorkTests : TestWithDatabaseBase
public class UnitOfWorkTests : UmbracoIntegrationTest
{
[Test]
public void ReadLockNonExisting()
{
var provider = TestObjects.GetScopeProvider(LoggerFactory);
var provider = ScopeProvider;
Assert.Throws<ArgumentException>(() =>
{
using (var scope = provider.CreateScope())
@@ -27,7 +27,7 @@ namespace Umbraco.Tests.Persistence
[Test]
public void ReadLockExisting()
{
var provider = TestObjects.GetScopeProvider(LoggerFactory);
var provider = ScopeProvider;
using (var scope = provider.CreateScope())
{
scope.ReadLock(Constants.Locks.Servers);
@@ -38,7 +38,7 @@ namespace Umbraco.Tests.Persistence
[Test]
public void WriteLockNonExisting()
{
var provider = TestObjects.GetScopeProvider(LoggerFactory);
var provider = ScopeProvider;
Assert.Throws<ArgumentException>(() =>
{
using (var scope = provider.CreateScope())
@@ -52,7 +52,7 @@ namespace Umbraco.Tests.Persistence
[Test]
public void WriteLockExisting()
{
var provider = TestObjects.GetScopeProvider(LoggerFactory);
var provider = ScopeProvider;
using (var scope = provider.CreateScope())
{
scope.WriteLock(Constants.Locks.Servers);

View File

@@ -200,7 +200,6 @@
<Compile Include="Persistence\LocksTests.cs" />
<Compile Include="Migrations\PostMigrationTests.cs" />
<Compile Include="Persistence\NPocoTests\NPocoSqlExtensionsTests.cs" />
<Compile Include="Persistence\UnitOfWorkTests.cs" />
<Compile Include="Testing\UmbracoTestBase.cs" />
<Compile Include="TestHelpers\TestObjects-Mocks.cs" />
<Compile Include="TestHelpers\TestObjects.cs" />