public void Courses_CorrectlyStudentLeaves() { var course = new Course(); var student = new Student("Gosho"); course.StudentJoins(student); Assert.IsTrue(course.StudentLeaves(student)); }
public void Courses_CanAddCorrectly() { var course = new Course(); var initialStudents = course.Count; var studentToAdd = new Student("Pesho"); course.StudentJoins(studentToAdd); Assert.AreEqual(initialStudents + 1, course.Count); }
public void Courses_TryToRemoveWhenCourseEmpty_ShouldThrow() { var course = new Course(); var student = new Student("Gosho"); TestDelegate test = () => { course.StudentLeaves(student); }; Assert.Throws(typeof(ArgumentException), test); }
static void Main(string[] args) { Student mitko = new Student("mitko","petrov", "ivanov",12343); mitko.FirstName = "mitko"; mitko.Faculty = Faculty.FMI; Student vladko =(Student) mitko.Clone(); mitko.Faculty = Faculty.CST; mitko.FirstName = "mdsadasdasd"; Console.WriteLine(vladko.FirstName); Console.WriteLine(vladko.Faculty); }
public void Courses_JoinMoreThan30Students_ShouldThrow() { var course = new Course(); TestDelegate test = () => { for (int i = 0; i < 31; i++) { var studentToAdd = new Student("Pesho"); course.StudentJoins(studentToAdd); } }; Assert.Throws(typeof(ArgumentException), test); }
static void Main(string[] args) { string[] name = new string[] { "Hristo", "Evgeny", "Miroslav", "Pavel", "Ivaylo" }; string[] family = new string[] { "Koilov", "Dimitrov", "Punkov", "Penkov", "Tsvetkov" }; int[] facultyNumber = new int[] { 455, 381, 220, 113, 666 }; int[] group = new int[] { 1, 1, 2, 3, 3 }; for (int i = 0; i < 5; i++) { Student studentInfo = new Student(); studentInfo.Name = name[i]; studentInfo.Family = family[i]; studentInfo.FacultyNumber = facultyNumber[i]; studentInfo.Group = group[i]; Console.WriteLine(studentInfo); } Console.WriteLine(); }
public void Students_UniqueNameIsInRange() { string name = "Pesho"; var student = new Student(name); Assert.IsTrue(student.UN >= 10000 && student.UN <= 99999); }
public void Students_ConstructorIsWorking_EntityIsNOtNull() { var name = "Pesho"; var student = new Student(name); Assert.IsNotNull(student); }
public void Students_ConstructorInitialisesCorrectly_StudentName() { string name = "Pesho"; var student = new Student(name); Assert.AreSame(name, student.Name); }