本文整理汇总了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);
}