Example #1
0
        public async Task GetWorkItems_PassesIncludeClosedWhenFalse()
        {
            // Arrange
            codePlexReader = new CodePlexWorkItemReader("TestProject", false, httpClientMock.HttpClient.Object);

            PagedWorkItemList list = BuildPagedList(6);

            httpClientMock.Summaries = list;
            httpClientMock.PageSize  = 2;
            httpClientMock.SetupMock();

            // Act
            IReadOnlyList <WorkItemSummary> readerItems = await codePlexReader.GetWorkItemsAsync(x => true);

            // Assert
            httpClientMock.HttpClient.Verify(x => x.DownloadStringAsync("https://TestProject.codeplex.com/project/api/issues?showClosed=False"), Times.Once);
            httpClientMock.HttpClient.Verify(x => x.DownloadStringAsync("https://TestProject.codeplex.com/project/api/issues?start=2&showClosed=False"), Times.Once);
        }
Example #2
0
        public async Task GetWorkItems_SucceedsLessThanOnePage()
        {
            // Arrange
            PagedWorkItemList list = BuildPagedList(2);

            httpClientMock.Summaries = list;
            httpClientMock.SetupMock();

            // Act
            IReadOnlyList <WorkItemSummary> readerItems = await codePlexReader.GetWorkItemsAsync(x => true);

            // Assert
            VerifyWorkItemsReturnedAreSameAsSetOnMock(readerItems, list);
        }