Ejemplo n.º 1
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);
        }
Ejemplo n.º 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.User api = new HyperWalletLibrary.Api.User(account);

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

            //Assert
            Assert.True(response.Count > 0);
        }
        public async Task <List <User> > GetAsync()
        {
            try
            {
                HyperWalletLibrary.Model.Response <HyperWalletLibrary.Model.User> response = await _api.GetAsync();

                _responseApiUserToListUser.Content = response;
                List <User> list = _responseApiUserToListUser.Convert();
                return(list);
            }
            catch (Exception)
            {
                return(null);
            }
        }