public async Task GetPlacementDescription_returns_requested_description()
        {
            var expected = Context.PlacementDescriptions.First();

            var actual = await repository.GetPlacementDescriptionAsync(expected.Id);

            Assert.Equal(actual.Id, expected.Id);
        }
Example #2
0
        public async Task <ActionResult <PlacementDescriptionDetailsDTO> > Get(int id, bool isTest = false)
        {
            try
            {
                var description = await repository.GetPlacementDescriptionAsync(id);

                return(Ok(description));
            }
            catch (ArgumentException e)
            {
                Util.LogError(e, isTest);
                return(StatusCode(StatusCodes.Status404NotFound));
            }
            catch (Exception e)
            {
                Util.LogError(e, isTest);
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }