示例#1
0
        public void GetTextDocuments()
        {
            var textDocuments = new List <TextDocument>
            {
                new TextDocument {
                    Id = "1", Text = "Test1", Name = "Test2", Owner = new ApplicationUser {
                        Id = "1"
                    }
                },
                new TextDocument {
                    Id = "2", Text = "Test3", Name = "Test4", Owner = new ApplicationUser {
                        Id = "2"
                    }
                },
            };
            var documentService = new Mock <IDocumentService>();

            documentService
            .Setup(service => service.GetDocumentsForUser())
            .Returns(textDocuments);
            var controller = new DocumentsController(documentService.Object);

            var result = controller.GetTextDocuments();

            Assert.Equal(textDocuments, result);
        }