Beispiel #1
0
 public void ManageProductUserEmailAddressAlreadyExists()
 {
     try
     {
         var response = InitializeProductUserDataProcess.ManageProductUser("BAR2017", "", "FirstName", "LastName", "*****@*****.**", "MobileNumber");
     }
     catch (Exception exception)
     {
         Assert.IsTrue(exception.Message == "EMAIL_ADDRESS_ALREADY_EXISTS");
     }
 }
Beispiel #2
0
 /// <summary>
 /// Gets the product user by product user identifier.
 /// </summary>
 /// <param name="productUserId">The product user identifier.</param>
 /// <returns></returns>
 public ProductUserEntity GetProductUserByProductUserId(long productUserId)
 {
     try
     {
         return(ConvertDataSetToProductUserEntity(InitializeProductUserDataProcess.GetProductUserByProductUserId(productUserId)));
     }
     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
         });
     }
 }
Beispiel #3
0
 /// <summary>
 /// Gets the product user by product identifier.
 /// </summary>
 /// <param name="productId">The product identifier.</param>
 /// <returns></returns>
 public ProductUserCollection GetProductUserByProductId(int productId)
 {
     try
     {
         return(ConvertDataSetToProductUserCollection(InitializeProductUserDataProcess.GetProductUserByProductId(productId)));
     }
     catch (Exception exception)
     {
         return(new ProductUserCollection {
             IsSuccess = false, Message = exception.InnerException?.Message ?? exception.Message
         });
     }
 }
Beispiel #4
0
 /// <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
         });
     }
 }
Beispiel #5
0
        public void GetProductUserByProductUserId()
        {
            var response = InitializeProductUserDataProcess.GetProductUserByProductUserId(100001);

            Assert.IsTrue(response != null && response.Tables[0].Rows.Count > 0);
        }
Beispiel #6
0
        public void ManageProductUser()
        {
            var response = InitializeProductUserDataProcess.ManageProductUser("BAR2017", "", "FirstName", "LastName", "*****@*****.**", "MobileNumber");

            Assert.IsTrue(response != null && response.Tables[0].Rows.Count > 0);
        }