public void DocumentExistsThrowsArgumentNullExceptionIfDocumentIsNull() { var noteBookCollection = new NotebookCollection(); noteBookCollection.CreateNotebook("notebook"); noteBookCollection.DocumentExists("notebook", null); }
public void AddDocumentToNotebookThrowsArgumentNullExceptionIfNotebookNameIsNull() { var noteBookCollection = new NotebookCollection(); noteBookCollection.CreateNotebook("notebook"); noteBookCollection.AddDocumentToNotebook(null, null); }
public void RemoveAllDocumentsThrowsArgumentNullExceptionIfNotebookNameIsNull() { var noteBookCollection = new NotebookCollection(); noteBookCollection.CreateNotebook("notebook"); noteBookCollection.RemoveAllDocuments(null); }
static NotebookListCache() { NotebookCollection = new NotebookCollection(NotebookDao.Inst.GetAllNotebook()); NotebookDao.Inst.NotebookCreated += NotebookListCache_NotebookCreated; NotebookDao.Inst.NotebookModified += NotebookListCache_NotebookModified; }
public void RemoveDocumentThrowsArgumentNullExceptionIfDocumentIsNull() { var noteBookCollection = new NotebookCollection(); noteBookCollection.CreateNotebook("notebook"); noteBookCollection.RemoveDocument("notebook", null); }
public void DocumenCountThrowsArgumentNullExceptionIfNotebookNameIsNull() { var noteBookCollection = new NotebookCollection(); noteBookCollection.CreateNotebook("notebook"); noteBookCollection.DocumentCount(null); }
public void CreateNoteBookInsertsNoteBookIntoCollection() { var noteBookCollection = new NotebookCollection(); noteBookCollection.CreateNotebook("myNoteBook"); Assert.AreEqual(1, noteBookCollection.CountNoteBooks); }
public NotebookList() { InitializeComponent(); NeedSaveSelectedNotebook = true; _notebookSource = NotebookListCache.GetNotebookCollection(); lbNotebook.ItemsSource = _notebookSource; }
public void RetrieveNotebookReturnsNamesNotebook() { var noteBookCollection = new NotebookCollection(); noteBookCollection.CreateNotebook("myNoteBook1"); noteBookCollection.CreateNotebook("myNoteBook2"); Assert.IsNotNull(noteBookCollection.RetrieveNoteBook("myNoteBook1")); }
public void RetrieveNotebookThrowsArgumentNullExceptionIfNotebookNameIsNull() { var noteBookCollection = new NotebookCollection(); noteBookCollection.CreateNotebook("myNoteBook1"); noteBookCollection.CreateNotebook("myNoteBook2"); noteBookCollection.RetrieveNoteBook("myNoteBook3"); }
public void RemoveNoteBookSuccessfullyRemovesNotebook() { var noteBookCollection = new NotebookCollection(); noteBookCollection.CreateNotebook("Exists"); noteBookCollection.RemoveNotebook("Exists"); Assert.AreEqual(0, noteBookCollection.CountNoteBooks); }
public NotebookList() { InitializeComponent(); NeedSaveSelectedNotebook = true; _notebookSource = NotebookListCache.GetNotebookCollection(); lbNotebook.ItemsSource = _notebookSource; }
public void CreateNoteBookThrowsInvalidOperationExceptionIfYouTryToInserTwoNotebooksOfTheSameName() { var noteBookCollection = new NotebookCollection(); noteBookCollection.CreateNotebook("myNoteBook"); noteBookCollection.CreateNotebook("myNoteBook"); Assert.AreEqual(2, noteBookCollection.CountNoteBooks); }
public void RetrieveNotebookNamesReturnsListofNotebookNames() { var noteBookCollection = new NotebookCollection(); noteBookCollection.CreateNotebook("notebook"); noteBookCollection.CreateNotebook("notebook2"); noteBookCollection.CreateNotebook("notebook3"); Assert.AreEqual(3, noteBookCollection.RetrieveNotebookNames().Count); }
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")); }
public void Init() { Notebooks = new NotebookCollection(); Notebooks.Load(); var c = Notebooks.FirstOrDefault(k=>k.Name == Notebooks.ActiveNotebookConfig); if (c != null) Notebooks.ActiveNotebook = c; if (Notebooks.ActiveNotebook == null && Notebooks.Any()) Notebooks.ActiveNotebook = Notebooks[0]; }
public void RemoveNoteBookThrowsArgumentNullExceptionIfNotebookNameIsNull() { var noteBookCollection = new NotebookCollection(); noteBookCollection.RemoveNotebook(null); }
public void RemoveNoteBookThrowsInvalidOperationExceptionIfNoteBookDoesNotExist() { var noteBookCollection = new NotebookCollection(); noteBookCollection.RemoveNotebook("Not Exists"); }