Exemplo n.º 1
0
        public async Task GetVacationPage_Should_Return_Ok()
        {
            // Arrange
            _vacationPageService.GetVacationPage(Arg.Any <int>()).Returns(new VacationPageDto());

            // Act
            var httpActionResult = await _vacationPageController.GetVacationPage();

            var response = await httpActionResult.ExecuteAsync(CancellationToken.None);

            // Assert
            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
        }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> GetVacationPage()
        {
            var vacationPageDto = await _vacationPageService.GetVacationPage(GetOrganizationId());

            if (vacationPageDto == null)
            {
                return(NotFound());
            }

            return(Ok(_mapper.Map <VacationPageDto, VacationPageViewModel>(vacationPageDto)));
        }