Пример #1
0
        public async Task <IActionResult> Get([FromQuery] GetAllPresidentsDto requestDto)
        {
            var response = await _whiteHouseAppService.GetAllPresidents(requestDto);

            return(CreateResponse <PresidentDto, string>()
                   .FromErrorEnum(PresidentDto.Error.GetAllPresident)
                   .WithMessage(AppConsts.LocalizationSourceName, PresidentDto.Error.GetAllPresident)
                   .WithDto(response)
                   .Build());
        }
Пример #2
0
        public async Task Should_Get_All_Presidents_With_Success()
        {
            // Act
            var response = await _whiteHouseAppService.GetAllPresidents(new GetAllPresidentsDto()
            {
                PageSize = 10
            });

            // Assert
            Assert.False(LocalNotification.HasNotification());
            response.Items.Count.ShouldBe(2);
        }