public void AddAlias(string domain)
        {
            var expectedAlias = string.Format("box.api.test.secondary@{0}", domain);
            var user          = CreateUser(domain);

            try
            {
                EmailAlias alias = Client.AddEmailAlias(user, expectedAlias);
                Assert.That(alias.Type, Is.EqualTo(ResourceType.EmailAlias));
                Assert.That(alias.Email, Is.EqualTo(expectedAlias));
            }
            finally
            {
                Client.Delete(user);
            }
        }
示例#2
0
 /// <summary>
 /// Delete an email alias for a user
 /// </summary>
 /// <param name="onSuccess">An action to perform following a successful delete</param>
 /// <param name="onFailure">An action to perform following a failed User operation </param>
 /// <param name="user">The aliased user</param>
 /// <param name="alias">The alias to delete</param>
 public void Delete(Action onSuccess, Action <Error> onFailure, EnterpriseUser user, EmailAlias alias)
 {
     GuardFromNull(user, "user");
     GuardFromNull(alias, "alias");
     DeleteEmailAlias(onSuccess, onFailure, user.Id, alias.Id);
 }
 /// <summary>
 /// Delete an email alias for a user
 /// </summary>
 /// <param name="onSuccess">An action to perform following a successful delete</param>
 /// <param name="onFailure">An action to perform following a failed User operation </param>
 /// <param name="user">The aliased user</param>
 /// <param name="alias">The alias to delete</param>
 public void Delete(Action onSuccess, Action<Error> onFailure, EnterpriseUser user, EmailAlias alias)
 {
     GuardFromNull(user, "user");
     GuardFromNull(alias, "alias");
     DeleteEmailAlias(onSuccess, onFailure, user.Id, alias.Id);
 }
示例#4
0
 /// <summary>
 /// Delete an email alias for a user
 /// </summary>
 /// <param name="user">The aliased user</param>
 /// <param name="alias">The alias to delete </param>
 public void Delete(EnterpriseUser user, EmailAlias alias)
 {
     GuardFromNull(user, "user");
     GuardFromNull(alias, "alias");
     DeleteEmailAlias(user.Id, alias.Id);
 }
 /// <summary>
 /// Delete an email alias for a user
 /// </summary>
 /// <param name="user">The aliased user</param>
 /// <param name="alias">The alias to delete </param>
 public void Delete(EnterpriseUser user, EmailAlias alias)
 {
     GuardFromNull(user, "user");
     GuardFromNull(alias, "alias");
     DeleteEmailAlias(user.Id, alias.Id);
 }