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")); }
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)); }
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); }
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")); }