public void AddStudentDuplicated_Test() { var enrollment = new CourseEnrollment( courseId: "Course_1", courseVersion: 0, courseTitle: "Course 1", capacity: 2, students: new string[] { "Student_1" }, summary: new CourseSummary() ); var student = TestHelpers.CreateStudent(id: 1, age: 30); enrollment.Invoking(it => it.AddStudent(student)) .Should().Throw <DomainException>(); }