using System; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection; using NUnit.Framework; using Umbraco.Core.Security; using Umbraco.Extensions; using Umbraco.Tests.Integration.Testing; namespace Umbraco.Tests.Integration.Umbraco.Web.BackOffice { [TestFixture] public class UmbracoBackOfficeServiceCollectionExtensionsTests : UmbracoIntegrationTest { [Test] public void AddUmbracoBackOfficeIdentity_ExpectBackOfficeUserStoreResolvable() { var userStore = Services.GetService>(); Assert.IsNotNull(userStore); Assert.AreEqual(typeof(BackOfficeUserStore), userStore.GetType()); } [Test] public void AddUmbracoBackOfficeIdentity_ExpectBackOfficeClaimsPrincipalFactoryResolvable() { var principalFactory = Services.GetService>(); Assert.IsNotNull(principalFactory); Assert.AreEqual(typeof(BackOfficeClaimsPrincipalFactory), principalFactory.GetType()); } [Test] public void AddUmbracoBackOfficeIdentity_ExpectBackOfficeUserManagerResolvable() { var userManager = Services.GetService(); Assert.NotNull(userManager); } protected override Action CustomTestSetup => (services) => services.AddUmbracoBackOfficeIdentity(); } }