Exemplo n.º 1
0
        public void DocumentCountToNotebookAddsDocumentToNoteBook()
        {
            var noteBookCollection = new NotebookCollection();

            noteBookCollection.CreateNotebook("notebook");

            var document = new Document(@"c:\fileExists.scp", "myDocument1", new TestFileProxy());

            noteBookCollection.AddDocumentToNotebook("notebook", document);

            Assert.AreEqual(1, noteBookCollection.DocumentCount("notebook"));
        }
Exemplo n.º 2
0
        public void AddDocumentsToNotebookAdds2DocumentsToNoteBook()
        {
            var noteBookCollection = new NotebookCollection();

            noteBookCollection.CreateNotebook("notebook");

            var document  = new Document(@"c:\fileExists.scp", "myDocument1", new TestFileProxy());
            var document2 = new Document(@"c:\fileExists.scp", "myDocument2", new TestFileProxy());

            noteBookCollection.AddDocumentToNotebook("notebook", document);
            noteBookCollection.AddDocumentToNotebook("notebook", document2);

            Assert.IsTrue(noteBookCollection.DocumentExists("notebook", document));
            Assert.IsTrue(noteBookCollection.DocumentExists("notebook", document2));
        }
Exemplo n.º 3
0
        public void RemoveDocumentFromNotebookThrowsInvalidOperationExceptionIfDocumentDoesntExist()
        {
            var noteBookCollection = new NotebookCollection();

            noteBookCollection.CreateNotebook("notebook");

            var document  = new Document(@"c:\fileExists.scp", "myDocument1", new TestFileProxy());
            var document2 = new Document(@"c:\fileExists.scp", "myDocument2", new TestFileProxy());
            var document3 = new Document(@"c:\fileExists.scp", "DoesNotExist", new TestFileProxy());

            noteBookCollection.AddDocumentToNotebook("notebook", document);
            noteBookCollection.AddDocumentToNotebook("notebook", document2);

            Assert.AreEqual(2, noteBookCollection.DocumentCount("notebook"));

            noteBookCollection.RemoveDocument("notebook", document3);
        }
Exemplo n.º 4
0
        public void RemoveAllDocumentsFromNotebookRemovesAllDocuments()
        {
            var noteBookCollection = new NotebookCollection();

            noteBookCollection.CreateNotebook("notebook");

            var document  = new Document(@"c:\fileExists.scp", "myDocument1", new TestFileProxy());
            var document2 = new Document(@"c:\fileExists.scp", "myDocument2", new TestFileProxy());

            noteBookCollection.AddDocumentToNotebook("notebook", document);
            noteBookCollection.AddDocumentToNotebook("notebook", document2);

            Assert.AreEqual(2, noteBookCollection.DocumentCount("notebook"));

            noteBookCollection.RemoveAllDocuments("notebook");

            Assert.AreEqual(0, noteBookCollection.DocumentCount("notebook"));
        }