public void TestDeleteSubjectReturnOne() { SubjectHandler _sut = SubjectHandler.Instance; int expected = 1; int actual = _sut.DeleteSubject(2); Assert.AreEqual(expected, actual); }
public void Delete() { bool exit = false; List <Subject> subjects = handler.GetSubjects(); while (!exit) { Console.Clear(); Console.CursorVisible = true; PrintTable(subjects); string id = GetId2(); handler.DeleteSubject(id); subjects.RemoveAt(handler.GetSubIndex(id, subjects)); Console.Clear(); PrintTable(subjects); Console.Write("Bạn có muốn nhập tiếp không?(esc để thoát)"); ConsoleKeyInfo exitStr = Console.ReadKey(); if (exitStr.Key == ConsoleKey.Escape) { Console.CursorVisible = false; exit = true; } } }