UNIT Test Fails, throws COMException "There is no MTS object context"
I have a unit test that contains several test cases. I set them up through the Test Project wizard. It is pretty standard procedure.
When I choose to run one of the test, I got the following error
Test method et.Exec.ProductionBase.Test.etProcessQCItemExecTest.CreateTest threw exception: System.Runtime.InteropServices.COMException: There is no MTS object context (Exception from HRESULT: 0x8004E004).
I couldn't figure out how to resolve this. I did a little 开发者_运维百科bit of digging online, but none seems to help. All Help is greatly appreciated.
I am running VSTS 2008 Development Edition.
You seem to be exercising production code that depends on having MTS installed. That would be called an integration test.
You need to decouple the production code under test from the MTS dependency and test in isolation (which would be a unit test).
精彩评论