public async void GetDocumentsByProduct1_50_2NotFound()
        {
            using (var context = DbTestContext.GenerateEmptyContext())
                using (var controller = new DocumentsInternalController(context, _mapper))
                {
                    var result = await controller.GetDocumentsByProduct(1, 50, 2);

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

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

                    DocumentDtoInternal d24 = GetTestDocumentDtoFromContext(54);

                    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(10));

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