Example #1
0
        public void RemoveDocumentThrowsArgumentNullExceptionIfDocumentIsNull()
        {
            var noteBookCollection = new NotebookCollection();

            noteBookCollection.CreateNotebook("notebook");
            noteBookCollection.RemoveDocument("notebook", null);
        }
Example #2
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);
        }
Example #3
0
        public void RemoveDocumentFromNotebookRemovesDocuments()
        {
            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.RemoveDocument("notebook", document);

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