public void Init() { _principal = Isolate.Fake.Instance<GenFormPrincipal>(); _identity = Isolate.Fake.Instance<IGenFormIdentity>(); Isolate.WhenCalled(() => _principal.Identity).WillReturn(_identity); Isolate.WhenCalled(() => GenFormPrincipal.GetPrincipal()).WillReturn(_principal); Isolate.WhenCalled(() => GenFormPrincipal.Login(_criteria)).IgnoreCall(); Isolate.WhenCalled(() => EnvironmentServices.SetEnvironment(string.Empty)).IgnoreCall(); _dto = GetAdminUserDto(); }
public void Init() { _principal = Isolate.Fake.Instance <GenFormPrincipal>(); _identity = Isolate.Fake.Instance <IGenFormIdentity>(); Isolate.WhenCalled(() => _principal.Identity).WillReturn(_identity); Isolate.WhenCalled(() => GenFormPrincipal.GetPrincipal()).WillReturn(_principal); Isolate.WhenCalled(() => GenFormPrincipal.Login(_criteria)).IgnoreCall(); Isolate.WhenCalled(() => EnvironmentServices.SetEnvironment(string.Empty)).IgnoreCall(); _dto = GetAdminUserDto(); }
private static void SetPrincipal(IGenFormIdentity identity) { _principal = new GenFormPrincipal(identity); Thread.CurrentPrincipal = _principal; }
private GenFormPrincipal(IGenFormIdentity identity) : base(identity, new String[] {}) { Identity = identity; }