public void GetDocument_ReturnsTheRequestedDocument()
        {
            // arrange
              var document = new Document { Id = Guid.NewGuid().ToString() };
              _documentRepository.CreateDocument(document);

              // act
              var result = Assert.IsType<OkObjectResult>(_controller.GetDocument(document.Id));

              // assert
              Assert.Equal(200, result.StatusCode);
              var returnedDocument = Assert.IsType<Document>(result.Value);
              Assert.Equal(document.Id, returnedDocument.Id);
        }
        public void PostDocument_AddsDocumentToTheContext_AndReturnsTheDocument()
        {
            // arrange
              var document = new Document { Id = Guid.NewGuid().ToString() };
              _documentRepository.CreateDocument(document);

              // act
              var result = Assert.IsType<CreatedResult>(_controller.PostDocument(document));

              // assert
              Assert.Equal(201, result.StatusCode);
              var returnedDocument = Assert.IsType<Document>(result.Value);
              Assert.Equal(document.Id, returnedDocument.Id);
              Assert.NotNull(_documentRepository.GetDocument(document.Id));
        }
 public Document CreateDocument(Document document)
 {
   throw new NotImplementedException();
 }
 public Document CreateDocument(Document document)
 {
     _documentContext.Add(document);
       return document;
 }