public void ManageProductUserEmailAddressAlreadyExists() { try { var response = InitializeProductUserDataProcess.ManageProductUser("BAR2017", "", "FirstName", "LastName", "*****@*****.**", "MobileNumber"); } catch (Exception exception) { Assert.IsTrue(exception.Message == "EMAIL_ADDRESS_ALREADY_EXISTS"); } }
/// <summary> /// Manages the product user. /// </summary> /// <param name="productUserEntity">The product user entity.</param> /// <returns></returns> public ProductUserEntity ManageProductUser(ProductUserEntity productUserEntity) { try { return(ConvertDataSetToProductUserEntity(InitializeProductUserDataProcess.ManageProductUser(productUserEntity.Product.ProductCode, productUserEntity.ProductUserCode, productUserEntity.FirstName, productUserEntity.LastName, productUserEntity.EmailAddress, productUserEntity.MobileNumber))); } catch (Exception exception) { return(new ProductUserEntity { IsSuccess = false, Message = exception.Message == BusinessLogicResource.EMAIL_ADDRESS_ALREADY_EXISTS ? BusinessLogicResource.ERROR_EMAIL_ADDRESS_ALREADY_EXISTS : exception.InnerException?.Message ?? exception.Message }); } }
public void ManageProductUser() { var response = InitializeProductUserDataProcess.ManageProductUser("BAR2017", "", "FirstName", "LastName", "*****@*****.**", "MobileNumber"); Assert.IsTrue(response != null && response.Tables[0].Rows.Count > 0); }