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.
abp/modules/permission-management/test/Volo.Abp.PermissionManageme.../Volo/Abp/PermissionManagement/AbpPermissionManagementAppl...

28 lines
859 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.Id.Returns(ci => CurrentUserId);
currentUser.IsAuthenticated.Returns(true);
services.AddSingleton(currentUser);
}
}
}