Example #1
0
 public void GetString_Exists_ReturnsString()
 {
     _attributes.GetString("property1").Should().Be.EqualTo("prop1");
 }
Example #2
0
        protected virtual CreateUserParams CreateUserParams(string userName, string password, IDirectoryAttributes entry)
        {
            string email = null;
            //if (!entry.AttributeNames.Contains(Directory.UserEmailAttribute))
            //    throw new ApplicationException(string.Format("Attribute {0} was not found on the object.", Directory.UserEmailAttribute));

            //var email = entry.GetString(Directory.UserEmailAttribute);
            //if (string.IsNullOrEmpty(email))
            //    throw new ApplicationException(string.Format("Attribute {0} is not set on the object.", Directory.UserEmailAttribute));
            if (entry.AttributeNames.Contains(Directory.UserEmailAttribute))
            {
                email = entry.GetString(Directory.UserEmailAttribute);
            }

            return new CreateUserParams(userName, password, email, null, null, true);
        }