PROG Exercise: Brush up, School

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.

Getting started

Make a new project in Visual Studio. Type: "Class Library".

Class Student

Make a class Student with properties like

Your class probably needs a constructor to deal with the invariants (requirements) mentioned.
Avoid duplicate code!

Unit test the class Student

Your unit test must have a good coverage.

Class Teacher

Make another class Teacher with properties like

Refactor: Baseclass

The classes Student and Teacher has a lot in common.

Put the common stuff (properties and methods) in a common baseclass Person. class diagram Student Teacher Person

Run the tests after the refactoring.

Extra: Document the class Student

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

Extras (if you have extra time...)

Override methods from class Object

Extract an interface IStudent from the Student class. Use the interface in your test - and maybe elsewhere.