Пример #1
0
        public void GetJournalsPageSize()
        {
            var proxy    = new JournalsProxy();
            var response = proxy.GetJournals(pageNumber: 1, pageSize: 2);

            Assert.NotNull(response);
            Assert.True(response.IsSuccessfull);
            Assert.Equal(response.DataObject.Journals.Count, 2);
        }
Пример #2
0
        public void GetJournalsSecondPage()
        {
            var proxy    = new JournalsProxy();
            var response = proxy.GetJournals(pageSize: 2);

            var idsFromPage1 = response.DataObject.Journals.Select(i => i.TransactionId).ToList();

            response = proxy.GetJournals(pageNumber: 2);

            Assert.NotNull(response);
            Assert.True(response.IsSuccessfull);

            response.DataObject.Journals.ForEach(i => Assert.DoesNotContain(i.TransactionId, idsFromPage1));
        }
Пример #3
0
        public static ProxyResponse <JournalTransactionSummaryResponse> AssertJournalsProxy(int?pageNumber = null, int?pageSize = null, DateTime?fromDate = null, DateTime?toDate = null,
                                                                                            DateTime?lastModifiedFromDate = null, DateTime?lastModifiedToDate = null, int?contactId = null, string tags = null, string tagFilterType = null)
        {
            var response = new JournalsProxy().GetJournals(pageNumber, pageSize, fromDate, toDate, lastModifiedFromDate, lastModifiedToDate, contactId, tags, tagFilterType);

            Assert.NotNull(response);
            Assert.True(response.IsSuccessfull, "Journal response not successfull");
            Assert.NotNull(response.DataObject);
            Assert.NotNull(response.DataObject.Journals);
            Assert.NotNull(response.DataObject._links);
            Assert.True(response.DataObject._links.Count > 0, "No hypermedia links in response");
            Assert.True(response.DataObject.Journals.Count > 0, "No journals in response");

            return(response);
        }