public NotesApiControllerTests() { _mockGetByTargetIdUseCase = new Mock <IGetByTargetIdUseCase>(); _mockPostNewNoteUseCase = new Mock <IPostNewNoteUseCase>(); _sut = new NotesApiController(_mockGetByTargetIdUseCase.Object, _mockPostNewNoteUseCase.Object); }
public void Get() { NotesApiController notesController = new NotesApiController(); List <tblNote> result = notesController.GetNotes(); Assert.IsNotNull(result); }
public async Task DeleteNote() { NotesApiController notesController = new NotesApiController(); tblNote tblNote = new tblNote(); tblNote.ID = 7; tblNote.Mode = "3"; tblNote.IsDelete = 1; var result = await notesController.AddNote(tblNote); Assert.AreEqual(1, result); }
public async Task UpdateNote() { NotesApiController notesController = new NotesApiController(); tblNote tblNote = new tblNote(); tblNote.ID = 9; tblNote.Title = "repos"; tblNote.Content = "hello,hey"; tblNote.IsPin = 0; tblNote.ColorCode = "white"; tblNote.Mode = "2"; tblNote.IsTrash = 0; tblNote.IsActive = 0; var result = await notesController.AddNote(tblNote); Assert.AreEqual(1, result); }
public async Task AddNote() { NotesApiController notesController = new NotesApiController(); tblNote tblNote = new tblNote(); tblNote.Title = "testnote"; tblNote.Content = "this is my content"; tblNote.IsPin = 0; tblNote.ColorCode = "black"; tblNote.Mode = "1"; tblNote.IsTrash = 1; tblNote.IsActive = 0; var result = await notesController.AddNote(tblNote); Assert.AreEqual(1, result); Assert.IsNotNull(result); }