2022-05-24 11:26:28 +01:00
|
|
|
using NUnit.Framework;
|
2022-05-25 10:48:45 +01:00
|
|
|
using Umbraco.Cms.Core.Scoping;
|
2022-05-24 11:26:28 +01:00
|
|
|
using Umbraco.Cms.Tests.Common.Testing;
|
|
|
|
|
using Umbraco.Cms.Tests.Integration.Testing;
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Scoping;
|
|
|
|
|
|
|
|
|
|
[TestFixture]
|
|
|
|
|
[UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)]
|
|
|
|
|
public class LegacyScopeProviderTests : UmbracoIntegrationTest
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void CreateScope_Always_ReturnsLegacyIScope()
|
|
|
|
|
{
|
2022-06-21 08:09:38 +02:00
|
|
|
var scopeProvider = GetRequiredService<IScopeProvider>();
|
2022-05-24 11:26:28 +01:00
|
|
|
|
|
|
|
|
using (var scope = scopeProvider.CreateScope())
|
|
|
|
|
{
|
2022-06-21 08:09:38 +02:00
|
|
|
Assert.IsInstanceOf<IScope>(scope);
|
2022-05-24 11:26:28 +01:00
|
|
|
}
|
|
|
|
|
}
|
2022-05-25 10:48:45 +01:00
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void LegacyScopeProvider_Always_IsACoreScopeProvider()
|
|
|
|
|
{
|
2022-06-21 08:09:38 +02:00
|
|
|
var scopeProvider = GetRequiredService<IScopeProvider>();
|
2022-05-25 10:48:45 +01:00
|
|
|
|
|
|
|
|
Assert.IsInstanceOf<ICoreScopeProvider>(scopeProvider);
|
|
|
|
|
}
|
2022-05-24 11:26:28 +01:00
|
|
|
}
|