コード例 #1
0
        public void TestPaperAddStudent()
        {
            var paper = new Paper("158.212", "Application Software Development", "Dr Teo Susnjak");

            paper.AddStudent("12345678");

            bool addSuccess;

            if (addSuccess = paper.AddStudent("12345678"))
            {
                Console.WriteLine("12345678 Added");
            }
            else
            {
                Console.WriteLine("12345678 Existed");
            }

            if (addSuccess = paper.AddStudent("12345677"))
            {
                Console.WriteLine("12345677 Added");
            }
            else
            {
                Console.WriteLine("12345677 Existed");
            }

            Console.Write("Student List:\n" + paper.StudentList());
        }
コード例 #2
0
        public void TestPaperRemoveStudent()
        {
            var paper = new Paper("158.212", "Application Software Development", "Dr Teo Susnjak");

            paper.AddStudent("12345678");

            bool removeSuccess;

            if (removeSuccess = paper.RemoveStudent("11111111"))
            {
                Console.WriteLine("11111111 successfully removed");
            }
            else
            {
                Console.WriteLine("11111111 is not existed");
            }

            if (removeSuccess = paper.RemoveStudent("12345678"))
            {
                Console.WriteLine("11111111 successfully removed");
            }
            else
            {
                Console.WriteLine("11111111 is not existed");
            }

            Console.Write("Student List:\n" + paper.StudentList());
        }