jozefizso/SystemWrapper

UnitTest is failing because of system language

Closed this issue · 3 comments

I just forked this repo and ran the unittests:
SystemWrapper.Tests.Reflection.AssemblyWrapTests.AssemblyInstance_AssemblyWrapCreatedWithDefaultConstructor_ThrowsException is failing.
It expects the Exception Message to be in english. Isn't that a bit specific?
My system language isn't english so these kind of tests are failing.
Maybe Assert.Throws<type> is enough?

The AssemblyInstance_AssemblyWrapCreatedWithDefaultConstructor_ThrowsException() test already checks for exception type using Assert.Throws<InvalidOperationException>.

The exception message thrown by the AssemblyWrap.AssemblyInstance is written in English. That test is shouldn't fail because of different system language.

If other tests check for English messages thrown by BCL, they should be marked with en-US UI culture so the test does not fail on localized systems.

The Load_NonExistingAssemblyString_ThrowsFileNotFoundException can fail on your system though.

Closing as there is no response.