urasandesu / Prig

Prig is a lightweight framework for test indirections in .NET Framework.
Other
117 stars 21 forks source link

Unable to execute test methods #67

Closed jaisondoss closed 8 years ago

jaisondoss commented 8 years ago

Am getting the below error when running the test method for DateTime.Now using Prig. Could you please help. Am executing the test method in VS 2015 Community edition in Windows 10. For initial setup i followed the instruction in this url : https://github.com/urasandesu/Prig/blob/master/README.md

Error Message: Test method UnitTestProject1.UnitTest1.TestMethod1 threw exception: System.BadImageFormatException: Could not load file or assembly 'mscorlib.v4.0.30319.v4.0.0.0.AMD64.Prig, Version=0.0.0.0, Culture=neutral, PublicKeyToken=f3c5adb85221ac4f' or one of its dependencies. An attempt was made to load a program with an incorrect format.

urasandesu commented 8 years ago

Thanks for the reporting! I could reproduce the problem on the MSTest. Is it same as your environment?

I think that this is a very hard problem to solve because it seems that an access violation occurs in the Visual Studio Test Execution Engine...

By the way, probably, this problem will not occur on the NUnit. If you possibly can, I recommend that you use NUnit instead.

jaisondoss commented 8 years ago

Thanks for the information! Using Nunit resolved the build error, but running the Tests in VS 2015 test explorer doesn't provide any output(result). It was just showing the below message in Output window. <NUnit Adapter 3.0.10.0: Test execution started Running selected tests in D:\Visual Studio 2015\Projects\UnitTestProject1\UnitTestLegacy\bin\Debug\UnitTestLegacy.dll NUnit3TestExecutor converted 1 of 1 NUnit test cases>

urasandesu commented 8 years ago

<NUnit Adapter 3.0.10.0: Test execution started Running selected tests in D:\Visual Studio 2015\Projects\UnitTestProject1\UnitTestLegacy\bin\Debug\UnitTestLegacy.dll NUnit3TestExecutor converted 1 of 1 NUnit test cases>

Prig hasn't supported NUnit Test Adapter 3.0.10 yet, sorry (NUnit 3.2.1 is the same status, too). Currently, Prig supports only the following version:

jaisondoss commented 8 years ago

Perfect. It worked for me. I was able to mock the 3rd party dlls too with the help of Prig plugin in ILSpy. Thanks a lot. You are a genius...

urasandesu commented 8 years ago

I'm glad to hear that :laughing:

I closed this issue because I have created the remaining issues against MSTest(#68) and NUnit 3.x(#69). Please contact me if there is problem.