Ought I to unit test constructors? Say I have a constructor like this:
IMapinfoWrapper wrapper;
public SystemInfo(IMapinfoWrapper mapinfoWrapper)
{
this.
Yes. If you have logic in your constructor, you should test it. Simply setting properties is not logic IMO. Conditionals, control flow, etc IS logic.
Edit: You should probably test for when IMapinfoWrapper is null, if that dependency is required. If so, then that is logic and you should have a test that catches your ArgumentNullException or whatever... your tests are specifications that define how the code behaves. If it throws an ArgumentNullException, then that should be specified in a test.
If the constructor contains some logic, such as initialize a class, I think you should test the very constructor. Or you can talk to the developer that putting initialization in the constructor will cut the testability of code under test.
Q: If you are setting a member variable in the constructor, why are you setting it.
A: Because you have a failing unit test that can only be made to pass by setting it in the constructor.
If you use this logic, where you only write code to cause a unit test to pass (Test Driven Development), then you will already have the answer to your question.