More unit test coverage. Switched from NUnit/Moq to xUnit/NSubstitute.