Ejemplo n.º 1
0
        /// <summary>Gets events.</summary>
        /// <param name="pagination">Pagination.</param>
        /// <param name="filter">Filters for events.</param>
        /// <param name="sort">Sort.</param>
        /// <returns>List of events matching passed filter criteria.</returns>
        public ListPaginated<EventDTO> GetAll(Pagination pagination, FilterEvents filter = null, Sort sort = null)
        {
            if (filter == null)
                return this.GetList<EventDTO>(MethodKey.EventsAll, pagination, "");

            return this.GetList<EventDTO>(MethodKey.EventsAll, pagination, "", sort, filter.GetValues());
        }
Ejemplo n.º 2
0
        public void Test_Wallets_Transactions_With_Sorting()
        {
            WalletDTO wallet = this.GetJohnsWallet();

            // create 2 payins
            this.GetJohnsPayInCardWeb();
            this.GetNewPayInCardWeb();
            Sort sort = new Sort();
            sort.AddField("CreationDate", SortDirection.desc);
            Pagination pagination = new Pagination(1, 20);
            FilterTransactions filter = new FilterTransactions();
            filter.Type = TransactionType.PAYIN;

            ListPaginated<TransactionDTO> transactions = this.Api.Wallets.GetTransactions(wallet.Id, pagination, filter, sort);

            Assert.IsTrue(transactions[0].CreationDate > transactions[1].CreationDate);
        }
Ejemplo n.º 3
0
        public void Test_Wallets_Transactions()
        {
            UserNaturalDTO john = GetJohn();

            WalletDTO wallet = CreateJohnsWallet();
            PayInDTO payIn = CreateJohnsPayInCardWeb(wallet.Id);

            Pagination pagination = new Pagination(1, 1);
            FilterTransactions filter = new FilterTransactions();
            filter.Type = TransactionType.PAYIN;
            ListPaginated<TransactionDTO> transactions = Api.Wallets.GetTransactions(wallet.Id, pagination, filter, null);

            Assert.IsTrue(transactions.Count == 1);
            Assert.IsTrue(transactions[0] is TransactionDTO);
            Assert.AreEqual(transactions[0].AuthorId, john.Id);
            AssertEqualInputProps(transactions[0], payIn);
        }