public void Setup() { this.host = new HostServer(14990); host.OnBeforeInitializeServices += c => { c.Register(c.NewComponent<IHostLogon,TestHostLogon>()); }; host.Initialize(); auth = host.Auth as DefaultHostAuthenticationProvider; Assert.NotNull(auth); Assert.NotNull(auth.HostLogonProvider); lp = auth.HostLogonProvider as DefaultHostLogonProvider; ls = auth.LoginSourceProvider as DefaultLoginSourceProvider; ls.Sources = new[] {new TestLoginSource()}; Assert.True(lp.HostLogons.OfType<TestHostLogon>().Any()); //this code is just tests that Auth uses logons from IoC lp.HostLogons = new[] {new TestHostLogon()}; //we require just one logon extension this.cl = new HttpClient(); host.Start(); Thread.Sleep(200); }
public void Setup() { this.host = new HostServer(14990); host.OnBeforeInitializeServices += c => { c.Register(c.NewComponent <IHostLogon, TestHostLogon>()); }; host.Initialize(); auth = host.Auth as DefaultHostAuthenticationProvider; Assert.NotNull(auth); Assert.NotNull(auth.HostLogonProvider); lp = auth.HostLogonProvider as DefaultHostLogonProvider; ls = auth.LoginSourceProvider as DefaultLoginSourceProvider; ls.Sources = new[] { new TestLoginSource() }; Assert.True(lp.HostLogons.OfType <TestHostLogon>().Any()); //this code is just tests that Auth uses logons from IoC lp.HostLogons = new[] { new TestHostLogon() }; //we require just one logon extension this.cl = new HttpClient(); host.Start(); Thread.Sleep(200); }