Exemple #1
0
        public async Task Should_Get_President_With_Success()
        {
            // Act
            var response = await _whiteHouseAppService.GetPresidentById(new RequestDto <string>("1"));

            // Assert
            Assert.False(LocalNotification.HasNotification());
            response.Id.ShouldBe("1");
            response.Name.ShouldBe("New President");
        }
Exemple #2
0
        public async Task <IActionResult> Get(string id, [FromQuery] RequestDto <string> requestDto)
        {
            var response = await _whiteHouseAppService.GetPresidentById(requestDto.WithId(id));

            return(CreateResponse <PresidentDto, string>()
                   .FromErrorEnum(PresidentDto.Error.GetPresident)
                   .WithMessage(AppConsts.LocalizationSourceName, PresidentDto.Error.GetPresident)
                   .WithDto(response)
                   .Build());
        }