Fixed a test issue where net45 methods were used in net40 profile

I found some tests that used methods added in .NET 4.5, despite the test being compiled under .NET 4.0, so I replaced them with equivalent methods.