Ejemplo n.º 1
0
        public async Task <IEnumerable <TaskDto> > GetUngroupedTasksAsync(bool completedTasks = false)
        {
            await AuthoriseAsync(_client, _authenticationService);

            var response = await _client.GetAsync <IEnumerable <TaskDto> >(TaskUrls.UngroupedTasksUrl(completedTasks));

            return(await _proxyHelper.ProcessResponseAsync(response, this));
        }
Ejemplo n.º 2
0
        public async Task GetUngroupedTasksAsync_Always_GetsTasks()
        {
            //Arrange
            var sut = CreateSut();

            SetupAuthentication();
            var tasks = new List <TaskDto>();

            var response = new Mock <IHttpResponse <IEnumerable <TaskDto> > >();

            Mocker.GetMock <IHttpClient>()
            .Setup(o => o.GetAsync <IEnumerable <TaskDto> >(TaskUrls.UngroupedTasksUrl(false)))
            .ReturnsAsync(response.Object);

            Mocker.GetMock <IProxyHelper>()
            .Setup(o => o.ProcessResponseAsync(response.Object, sut))
            .ReturnsAsync(tasks);

            //Act
            var result = await sut.GetUngroupedTasksAsync(false);

            //Assert
            result.ShouldBeEmpty();
        }