本文整理匯總了C#中School.Course.RemoveStudentByID方法的典型用法代碼示例。如果您正苦於以下問題:C# Course.RemoveStudentByID方法的具體用法?C# Course.RemoveStudentByID怎麽用?C# Course.RemoveStudentByID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類School.Course
的用法示例。
在下文中一共展示了Course.RemoveStudentByID方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Main
static void Main(string[] args)
{
Course math = new Course("Math");
for (int i = 0; i < 30; i++)
{
math.AddStudent(new Student("Test Student : " + i));
}
Console.WriteLine(math);
math.RemoveStudentByID(10000);
math.RemoveStudentByID(10001);
math.RemoveStudentByID(10002);
Console.WriteLine(math);
//throw exception
//math.RemoveStudentByID(9);
SchoolDem PMG = new SchoolDem("PMG");
PMG.AddCourse(math);
//throwing exceptions
//PMG.AddCourse(math);
//PMG.AddCourse(null);
Console.WriteLine(PMG);
var school = new SchoolDem("Banichka");
var course = new Course("Alg");
school.AddCourse(course);
Console.WriteLine(school);
}
示例2: RemoveStudenFromEmptyList_ThrowException
public void RemoveStudenFromEmptyList_ThrowException()
{
var spirt = new Course("Spirt");
spirt.RemoveStudentByID(99);
}
示例3: RemoveStudenByIncorrectID_ThrowException
public void RemoveStudenByIncorrectID_ThrowException()
{
var spirt = new Course("Spirt");
spirt.AddStudent(new Student("sad"));
spirt.RemoveStudentByID(99);
}
示例4: RemovingStudentThatDoesNotExistInTheList
public void RemovingStudentThatDoesNotExistInTheList()
{
var bakery = new Course("Bakery");
var student = new Student("Fhilip");
bakery.AddStudent(student);
bakery.RemoveStudentByID(20000);
}
示例5: RemovingCorrectlyStudent_TrueIfRemovedCorrectly
public void RemovingCorrectlyStudent_TrueIfRemovedCorrectly()
{
var spirt = new Course("Spirt");
var student = new Student("sad");
spirt.AddStudent(student);
spirt.RemoveStudentByID(student.UniqueID);
var index = spirt.ToString().IndexOf(student.ToString());
Assert.IsTrue(index < 0);
}