* Separate legacy scope provider interface and explicitly implement. * Don't rely on legacy scope provider for existing tests. * Assert correct type returned when using legacy scope provider.
22 lines
674 B
C#
22 lines
674 B
C#
using NUnit.Framework;
|
|
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()
|
|
{
|
|
var scopeProvider = GetRequiredService<global::Umbraco.Cms.Core.Scoping.IScopeProvider>();
|
|
|
|
using (var scope = scopeProvider.CreateScope())
|
|
{
|
|
Assert.IsInstanceOf<global::Umbraco.Cms.Core.Scoping.IScope>(scope);
|
|
}
|
|
}
|
|
}
|