In this exercise you must brush up some of your knowledge from 1st and 2nd semester.
You must program a class Student, Unit test the class, and finally document the class.
Make a new project in Visual Studio. Type: "Class Library".
Make a class Student with properties like
public enum GenderType { Male, Female }
GenderType
to define a property Gender
.
Your class probably needs a constructor to deal with the invariants (requirements) mentioned.
Avoid duplicate code!
Your unit test must have a good coverage.
Make another class Teacher with properties like
The classes Student and Teacher has a lot in common.
Put the common stuff (properties and methods) in a common baseclass Person.
Run the tests after the refactoring.
Document your class Student using /// (triple slash comments).
Document all public parts of your class.
Document your code with XML comments
You can even generate nice looking HTML documentation for your classes
Override methods from class Object
Extract an interface IStudent from the Student class. Use the interface in your test - and maybe elsewhere.