예제 #1
0
        public void Writes_Document_To_Store()
        {
            var mockTextIO = new Mock<ITextIO>();
            mockTextIO.Setup(
                m => m.WriteDocument(
                    It.Is<string>(v => v == "test"),
                    It.Is<string>(v => v == "C:/TEST/testPath")
                ));

            IDocumentRepository documentRepository = new DocumentRepository
                (
                    "C:/TEST",mockTextIO.Object,
                    new DocumentPathResolver(),
                    new DocumentFactory()
                );

            documentRepository.SaveDocument(new Document{body="test",path = "/testPath"});

            mockTextIO.VerifyAll();
        }