Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
858 B

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using NSubstitute;
using Volo.Abp.Users;
namespace Volo.Abp.PermissionManagement
{
public class AbpPermissionManagementApplicationTestBase : PermissionManagementTestBase<AbpPermissionManagementApplicationTestModule>
{
protected Guid? CurrentUserId { get; set; }
protected AbpPermissionManagementApplicationTestBase()
{
CurrentUserId = Guid.NewGuid();
}
protected override void AfterAddApplication(IServiceCollection services)
{
var currentUser = Substitute.For<ICurrentUser>();
currentUser.Roles.Returns(new []{ "admin" });
currentUser.IsAuthenticated.Returns(true);
services.AddSingleton(currentUser);
}
}
}