Esempio n. 1
0
        public async Task WhiteHouse_Service_Return_PresidentById()
        {
            // Act
            var response = await _whiteHouseService.GetPresidentById(new RequestDto <string>("1"));

            // Assert
            Assert.False(LocalNotification.HasNotification());
            Assert.True(response.Id == "1");
            Assert.True(response.Name == "George Washington");
        }
Esempio n. 2
0
        public async Task <PresidentDto> GetPresidentById(RequestDto <string> id)
        {
            if (string.IsNullOrWhiteSpace(id.GetId()))
            {
                RaiseNotification(nameof(id));
            }

            if (Notification.HasNotification())
            {
                return(new PresidentDto());
            }

            var entity = await _whiteHouserService.GetPresidentById(id);

            return(entity.MapTo <PresidentDto>());
        }