public async void GetDocumentsByTypeWithIncorrectProductId()
        {
            using (var context = DbTestContext.GenerateEmptyContext())
                using (var controller = new DocumentsInternalController(context, _mapper))
                {
                    var result = await controller.GetDocumentsByType(99);

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

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

                    DocumentDtoInternal d4 = GetTestDocumentDtoFromContext(4);

                    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;

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