private IdentifierAccess CreateIdentifier(string text) { if (_identifiers.Contains(text)) { return(_identifiers[text]); } else { var identifier = new IdentifierAccess(text); _identifiers.Add(identifier); return(identifier); } }
public void TestGetUser() { var baseLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); SampleConnector connector = new SampleConnector(); connector.Initialize(baseLocation, null); var identifiers = new IdentifierCollection(); identifiers.Add(new UpnIdentifier("*****@*****.**")); var attributes = new List <IAttribute>(); var profile = connector.GetUser(identifiers, attributes); Assert.IsTrue(profile.Properties.Any(), "Failed to get attributes"); Assert.IsTrue(profile.Identifiers.Identifiers.Any(), "Failed to get identifiers"); }
public void TestUpdate() { var baseLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); SampleConnector connector = new SampleConnector(); connector.Initialize(baseLocation, null); var identifiers = new IdentifierCollection(); identifiers.Add(new UpnIdentifier("*****@*****.**")); var emergencyContactValue = "You need a " + Guid.NewGuid().ToString("D") + " emergency contact"; // set the value connector.UpdateAttribute(identifiers, new SampleAttribute("emergencycontact"), emergencyContactValue); var attributes = new List <IAttribute>(); var profile = connector.GetUser(identifiers, attributes); Assert.IsTrue(profile.Properties["emergencycontact"].ToString() == emergencyContactValue, "Expected attibute value to be the new one. It wasn't."); }