示例#1
0
        public async void PostAsync_LinksCount_MoreThen_0()
        {
            //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     = "******"
                }
            };

            HyperWalletLibrary.Api.Payment api = new HyperWalletLibrary.Api.Payment(account);
            Payment item = new Payment()
            {
                Amount           = 20,
                DestinationToken = "usr-4beda015-edb5-4dd1-a881-60ae59c8db50"
            };

            //Act
            Payment response = await api.PostAsync(item);

            //Assert
            Assert.True(response.Links.Count > 0);
        }
示例#2
0
        public async void GetAsync_Count_MoreThen_0()
        {
            //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     = "******"
                }
            };

            HyperWalletLibrary.Api.Payment api = new HyperWalletLibrary.Api.Payment(account);

            //Act
            Response <Payment> response = await api.GetAsync();

            //Assert
            Assert.True(response.Count > 0);
        }
示例#3
0
        public async void GetAsync_WithToken_LinksCount_MoreThen_0()
        {
            //Arrange
            string token = "usr-01f5cfa0-5507-4d14-a9f8-df0791b5eea9";
            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     = "******"
                }
            };

            HyperWalletLibrary.Api.User api = new HyperWalletLibrary.Api.User(account);

            //Act
            User response = await api.GetAsync(token);

            //Assert
            Assert.True(response.Links.Count > 0);
        }
示例#4
0
        public async void GetAsync_WithToken_LinksCount_MoreThen_0()
        {
            //Arrange
            string token = "pmt-9ba25552-5717-423f-ac6b-b86f2946dd58";
            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     = "******"
                }
            };

            HyperWalletLibrary.Api.Payment api = new HyperWalletLibrary.Api.Payment(account);

            //Act
            Payment response = await api.GetAsync(token);

            //Assert
            Assert.True(response.Links.Count > 0);
        }
        public async void PutAsync_StatusCode_200_OK()
        {
            //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/usr-01f5cfa0-5507-4d14-a9f8-df0791b5eea9/";
            User   item    = new User()
            {
                LastName = "Ddd"
            };

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

            //Assert
            Assert.True(response.StatusCode == HttpStatusCode.OK);
        }
        public async void SendAsync_Get_StatusCode_200_OK()
        {
            //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/";
            HyperWalletSenderSettings <User> settings = new HyperWalletSenderSettings <User>()
            {
                Type = HttpType.Get
            };

            //Act
            HttpResponseMessage response = await sender.SendAsync(address, settings);

            //Assert
            Assert.True(response.StatusCode == HttpStatusCode.OK);
        }
        public async void SendAsync_Post_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"
            };
            HyperWalletSenderSettings <User> settings = new HyperWalletSenderSettings <User>()
            {
                Type = HttpType.Post,
                Data = item
            };

            //Act
            HttpResponseMessage response = await sender.SendAsync(address, settings);

            //Assert
            Assert.True(response.StatusCode == HttpStatusCode.Created);
        }
示例#8
0
        public async void PostAsync_LinksCount_MoreThen_0()
        {
            //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     = "******"
                }
            };
            ConcreteHyperWalletApiUser api = new ConcreteHyperWalletApiUser(account);
            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
            User response = await api.PostAsync(item);

            //Assert
            Assert.True(response.Links.Count > 0);
        }
示例#9
0
        public async void SendAsync_Post_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();
            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"
            };
            HyperWalletSenderSettings <Payment> settings = new HyperWalletSenderSettings <Payment>()
            {
                Type = HttpType.Post,
                Data = item
            };

            //Act
            HttpResponseMessage response = await sender.SendAsync(address, settings);

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