Simplify MSBuild-based tests.

Refactor MSBuild integration for unit tests to make each test shorter and easier to write.