public void CreateAndSaveNoteTest() { NoteVm.Note1 = "blah"; NoteVm.SelectedStationItem.StationName = "Anholt"; NoteVm.DueDate = DateTimeOffset.Now; DateTime convertedDate = DateConverter.ConvertToDate(NoteVm.DueDate); NoteVm.SelectedStationItem.StationId = 6001; NoteVm.UserId = 1; Notes note = new Notes(NoteVm.NotesId, NoteVm.Note1, convertedDate, NoteVm.SelectedStationItem.StationId, NoteVm.UserId); Save.Save(note, "Notes"); int myValue = 5; int realValue = Collection.LoadNotes().Count; Assert.AreEqual(myValue, realValue); //passed }
public async void CreateAndSaveNote() { if (!string.IsNullOrEmpty(_noteVm.Note1) && _noteVm.SelectedStationItem.StationName != null) { DateTime convertedDate = _dateConverter.ConvertToDate(_noteVm.DueDate); int convertedStationName = _noteVm.SelectedStationItem.StationId; _noteObj = new Notes(_noteVm.NotesId, _noteVm.Note1, convertedDate, convertedStationName, _noteVm.UserId); await _savedNote.Save(_noteObj, "Notes"); FrameNavigateClass _frame = new FrameNavigateClass(); _frame.ActivateFrameNavigation(typeof(MenuPage)); MessageDialog msg = new MessageDialog("You just created a note!"); await msg.ShowAsync(); } else { var msg = new MessageDialog("Please fill in the information"); await msg.ShowAsync(); } }