コード例 #1
0
        public void TestDeleteSubjectReturnOne()
        {
            SubjectHandler _sut     = SubjectHandler.Instance;
            int            expected = 1;
            int            actual   = _sut.DeleteSubject(2);

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
ファイル: SubjectUI.cs プロジェクト: ghostWood1071/Project1
        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;
                }
            }
        }