コード例 #1
0
 public void CreateUserTests()
 {
     UserCreateRequest request = new UserCreateRequest();
     InitializeCreateUserRequest(request);
     MadMoneyService madMoneyService = new MadMoneyService();
     var response = madMoneyService.CreateUser(request);
     Assert.IsTrue(response.isSuccess);
     Assert.IsNotNull(response.apkTree);
     Assert.IsNotNull(response.uid);
 }
コード例 #2
0
 private void InitializeCreateUserRequest(UserCreateRequest request)
 {
     Address address = new Address();
     address.CountryCode = "IN";
     address.State = "MH";
     address.City = "PUNE";
     address.Local = "KHARADI";
     request.Address = address;
     request.FName = "SUJAN";
     request.LName = "SINGH";
     request.PublicKey = GetPublicKey();
 }
コード例 #3
0
 public void CreateUser(UserCreateRequest data, string uid)
 {
     string sqlQUery = "INSERT INTO " + USER_TABLE_NAME + " VALUES(@FName, @LName, @Address, @UserPublicKey, @userAddressId)";
     try
     {
         SqlCommand cmd = new SqlCommand(sqlQUery, CON);
         cmd.Parameters.AddWithValue("@FName", data.FName);
         cmd.Parameters.AddWithValue("@LName", data.LName);
         cmd.Parameters.AddWithValue("@Address", data.Address.CountryCode + "/" + data.Address.State + "/" + data.Address.City + "/" + data.Address.Local);
         cmd.Parameters.AddWithValue("@UserPublicKey", data.PublicKey);
         cmd.Parameters.AddWithValue("@userAddressId", uid);
         CON.Open();
         cmd.ExecuteNonQuery();
     }
     catch (Exception e) { throw new Exception("Error while connecting database", e); }
     finally { if (CON != null)CON.Close(); }
 }