| 1234567891011121314151617181920212223242526 |
- using System.Security.Principal;
- using Quadarax.Foundation.Core.Data.Interface.Domain;
- namespace Quadarax.Application.QLiberace.Base.Tests.Services.Fakes
- {
- public class ContextFake : IContext
- {
- public IPrincipal CurrentUser { get; }
- public ContextFake()
- {
- var genericIdentity = new GenericIdentity("genericIdentity");
- CurrentUser = new GenericPrincipal(genericIdentity, new string[] { });
- }
- public ContextFake(IPrincipal currentUser)
- {
- CurrentUser = currentUser;
- }
- public TContext GetContext<TContext>() where TContext : IContext
- {
- return (TContext)(IContext) this;
- }
- }
- }
|