public async void PostAsync_StatusCode_201_Created()
        {
            //Arrange
            IHyperWalletAccount account = new HyperWalletAccount
            {
                Main = new HyperWalletProgram()
                {
                    Password     = "******",
                    ProgramToken = "prg-91b2bb2f-88c4-4a5d-b6ae-ef24b25567a3",
                    Username     = "******"
                },
                Portal = new HyperWalletProgram()
                {
                    Password     = "******",
                    ProgramToken = "prg-a3054235-6b29-432a-a01e-47ff2d944941",
                    Username     = "******"
                }
            };
            HyperWalletSender <User> sender = new HyperWalletSender <User>(account);
            string address = "https://api.sandbox.hyperwallet.com/rest/v3/users/";
            int    id      = new Random().Next(100000000, 1000000000);
            User   item    = new User()
            {
                ProfileType   = ProfileTypes.INDIVIDUAL,
                ProgramToken  = "prg-a3054235-6b29-432a-a01e-47ff2d944941",
                ClientUserId  = "t-" + id,
                FirstName     = "John",
                LastName      = "Developer",
                Email         = string.Format("t-{0}@email.com", id),
                DateOfBirth   = new DateTime(1991, 2, 15),
                Country       = "US",
                StateProvince = "CA",
                AddressLine1  = "575 Market St",
                City          = "San Francisco",
                PostalCode    = "94105"
            };

            //Act
            HttpResponseMessage response = await sender.PostAsync(address, item);

            //Assert
            Assert.True(response.StatusCode == HttpStatusCode.Created);
        }
Exemplo n.º 2
0
        public async void PostAsync_StatusCode_201_Created()
        {
            //Arrange
            IHyperWalletAccount account = new HyperWalletAccount
            {
                Main = new HyperWalletProgram()
                {
                    Password     = "******",
                    ProgramToken = "prg-91b2bb2f-88c4-4a5d-b6ae-ef24b25567a3",
                    Username     = "******"
                },
                Portal = new HyperWalletProgram()
                {
                    Password     = "******",
                    ProgramToken = "prg-a3054235-6b29-432a-a01e-47ff2d944941",
                    Username     = "******"
                }
            };
            HyperWalletSender <Payment> sender = new HyperWalletSender <Payment>(account);
            string  address = "https://api.sandbox.hyperwallet.com/rest/v3/payments/";
            int     id      = new Random().Next(100000000, 1000000000);
            Payment item    = new Payment()
            {
                Amount           = 20,
                ClientPaymentId  = id.ToString(),
                Currency         = "USD",
                DestinationToken = "usr-4beda015-edb5-4dd1-a881-60ae59c8db50",
                ProgramToken     = "prg-a3054235-6b29-432a-a01e-47ff2d944941",
                Purpose          = "OTHER"
            };

            //Act
            HttpResponseMessage response = await sender.PostAsync(address, item);

            //Assert
            Assert.True(response.StatusCode == HttpStatusCode.Created);
        }