public void DoesItGetTheCorrectIdOfANote() { Note note = new Note("TestTitle", "SampleDescription"); note.UserID = 1; noteDatabaseFunctions.MakeNewNote(note); note.NoteId = noteDatabaseFunctions.ShowAll().Last().NoteId; Assert.AreEqual(note.NoteId, noteDatabaseFunctions.ShowSpecificNote(noteDatabaseFunctions.ShowAll().Last().NoteId).NoteId); noteDatabaseFunctions.DeleteNote(note.NoteId); }
/// <summary> /// A private method for note creation. Connects the database and presentation layers. /// </summary> private void CreateNote() { Note newNote = userInterface.CreateNote(); newNote = NoteFieldsValidation(newNote); newNote.UserID = currentUser.UserId; noteDatabaseFunctions.MakeNewNote(newNote); }