Example #1
0
        public async Task <ItemGroupDto> GetAsync(Guid id, bool includeTasks = false)
        {
            await AuthoriseAsync(_client, _authenticationService);

            var response = await _client.GetAsync <ItemGroupDto>(GroupUrls.GetGroupUrl(id, includeTasks));

            return(await _proxyHelper.ProcessResponseAsync(response, this));
        }
Example #2
0
        public async Task GetAsync_Always_Gets()
        {
            //Arrange
            var sut      = CreateSut();
            var id       = Guid.NewGuid();
            var response = new Mock <IHttpResponse <ItemGroupDto> >();

            Mocker.GetMock <IHttpClient>()
            .Setup(o => o.GetAsync <ItemGroupDto>(GroupUrls.GetGroupUrl(id, true)))
            .ReturnsAsync(response.Object);

            var groupDto = new ItemGroupDto(id, "", "", "", new List <TaskDto>());

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

            //Act
            var result = await sut.GetAsync(id, true);

            //Assert
            result.Id.ShouldBe(id);
        }