UNIT Test Fails, throws COMException "There is no MTS object context"

0

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.

c#
unit-testing
asked on Stack Overflow Sep 1, 2010 by doglin • edited Aug 14, 2014 by MPelletier

1 Answer

1

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).

answered on Stack Overflow Aug 18, 2011 by Mahol25

User contributions licensed under CC BY-SA 3.0