Example #1
0
        public void Should_Get_Person_With_Success()
        {
            //Act
            var response = _personAppService.Get(new RequestDto(1));

            //Assert
            Assert.False(LocalNotification.HasNotification());
            response.Id.ShouldBe(1);
            response.Name.ShouldBe(_person.Name);
        }
        public void Should_Return_Found_PersonDto()
        {
            var existingPersonId = 1;

            var output = Should.NotThrow(() =>
            {
                return(_personAppService.Get(new GetPersonInput {
                    PersonId = existingPersonId
                }));
            });

            output.ShouldBeOfType <PersonDto>();
            output.Id.ShouldBe(existingPersonId);
        }
        //GET: /<controller>/
        public IActionResult Index()
        {
            var output = _personAppService.Get();
            var model  = new PersonDtoGetAll(output);

            return(View(model));
        }
Example #4
0
        public IActionResult Get(int id, [FromQuery] RequestDto requestDto)
        {
            requestDto.WithId(id);
            var response = _personAppService.Get(requestDto);

            return(CreateResponseOnGet(response, PERSON_NAME));
        }
 public PersonSelectListDto(IPersonAppService personAppService)
 {
     Persons = personAppService.Get().ToList();
 }