Question About NerdDinner Controller Constructors
- by Gavin Draper
I've been looking at the Nerd Dinner app, more specifically how it handles its unit tests.
The following constructors for the RSVPController are confusing my slightly
public RSVPController()
: this(new DinnerRepository()) {
}
public RSVPController(IDinnerRepository repository) {
dinnerRepository = repository;
}
From what I can tell the second one is used by the unit tests so it can use Fake repositories. What I cant work out is what the first constructor does. It doesn't seem to ever set the dinnerRepository variable, it seems to imply its inheriting from something but I really don't get it.
Can anyone explain?
Thanks