public void TestGetServerOrder() { IUser user = directory.GetUser(C.DEV_User1); string dnsDomain = this.discoveryServices.GetDomainNameDns(user.Sid); AuthorizationContextDomainDetails d = new AuthorizationContextDomainDetails(user.Sid.AccountDomainSid, dnsDomain, discoveryServices); d.Mapping = new AuthorizationServerMapping { Domain = dnsDomain, DisableLocalFallback = true, Servers = new List <AuthorizationServer> { new AuthorizationServer { Name = "madeup.local", Type = AuthorizationServerType.Default }, new AuthorizationServer { Name = "madeup2.local", Type = AuthorizationServerType.Default } } }; Assert.AreEqual("madeup.local", d.GetServer(false).Name); // Get the first entry Assert.AreEqual("madeup.local", d.GetServer(false).Name); // Call GetServer again and we should get the same entry Assert.AreEqual("madeup2.local", d.GetServer(true).Name); // Ask for the next entry Assert.AreEqual("madeup2.local", d.GetServer(false).Name); // Make sure we still get the same entry Assert.AreEqual("madeup.local", d.GetServer(true).Name); // Make sure we return to the start }
public void TestGetDC() { IUser user = directory.GetUser(C.DEV_User1); string dnsDomain = this.discoveryServices.GetDomainNameDns(user.Sid); string dc = this.discoveryServices.GetDomainController(dnsDomain); AuthorizationContextDomainDetails d = new AuthorizationContextDomainDetails(user.Sid.AccountDomainSid, dnsDomain, discoveryServices); d.Mapping = new AuthorizationServerMapping { Domain = dnsDomain, }; Assert.AreEqual(dc, d.GetServer(false).Name); // Get the first entry }
public void TestGetDC() { IUser user = directory.GetUser("IDMDEV1\\user1"); string dnsDomain = this.directory.GetDomainNameDnsFromSid(user.Sid); string dc = this.directory.GetDomainControllerForDomain(dnsDomain); AuthorizationContextDomainDetails d = new AuthorizationContextDomainDetails(user.Sid.AccountDomainSid, dnsDomain, directory); d.Mapping = new AuthorizationServerMapping { Domain = dnsDomain, }; Assert.AreEqual(dc, d.GetServer(false)); // Get the first entry }