public async void GetDocuments50_5NotFound()
        {
            using (var context = DbTestContext.GenerateContextWithData())
                using (var controller = new DocumentsInternalController(context, _mapper))
                {
                    var result = await controller.GetDocuments(50, 5);

                    Assert.IsType <NotFoundResult>(result);
                }
        }
        public async void GetDocumentsEmptyContextNotFound()
        {
            using (var context = DbTestContext.GenerateEmptyContext())
                using (var controller = new DocumentsInternalController(context, _mapper))
                {
                    var result = await controller.GetDocuments();

                    Assert.IsType <NotFoundResult>(result);
                }
        }
        public async void GetDocumentsBadModel()
        {
            using (var context = DbTestContext.GenerateContextWithData())
                using (var controller = new DocumentsInternalController(context, _mapper))
                {
                    controller.ModelState.AddModelError("an error", "some error");
                    var result = await controller.GetDocuments();

                    Assert.IsType <BadRequestObjectResult>(result);
                }
        }
        public async void GetDocuments20_2ReturnsListOfDocuments()
        {
            using (var context = DbTestContext.GenerateContextWithData())
                using (var controller = new DocumentsInternalController(context, _mapper))
                {
                    var result = await controller.GetDocuments(20, 2);

                    DocumentDtoInternal d44 = GetTestDocumentDtoFromContext(44);

                    Assert.NotNull(result);
                    var okObjectResult = Assert.IsType <OkObjectResult>(result);
                    var resultValue    = okObjectResult.Value;
                    Assert.IsAssignableFrom <IEnumerable <DocumentDtoInternal> >(resultValue);
                    Assert.NotEmpty((IEnumerable <DocumentDtoInternal>)resultValue);

                    IEnumerable <DocumentDtoInternal> resultValueList = (IEnumerable <DocumentDtoInternal>)resultValue;
                    Assert.True(resultValueList.Count().Equals(20));

                    DocumentDtoInternal d = (DocumentDtoInternal)resultValueList.Single(r => r.Id == 44);
                    Assert.True(d.Equals(d44));
                    Assert.True(d.Equals(d44, true));
                }
        }