chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
I'm trying to test a DTS Custom transformation pipeline component.
This is a .Net component, executed from the DTS, a COM component.

My test is executing from VS and the unit test adapter process.
The tests loads and execute a DTS package, a COM component.
The COM component loads my transformation, the SUT, in the VSTest host process.
So its

Test.net -> DTS.COM -> SUT.Net

The problem is that my SUT is not executing in the same process as the Test. The effect is that the mocking I set up in the test does not affect my SUT.

Any tips on how to mock the correct process?
asked by krok (3.9k points)

2 Answers

0 votes
Hi,

In general mocking you setup will be applied only in the scope of the running process.

Which part do you want to test here?

If you are trying to test the SUT classes themselves it would be very difficult to do that.
two approaches that might work will be to :
1. Somehow insert test code that will setup an expectations between the DTS.COM and the SUT. (i.e. on the scope of the second process).

2. trying to bypass the regular flow and executing code from the SUT component directly by the testing framework (if its a .net component you should be able to do that)

If you are trying to test another component which uses the SUT (i.e. you want to mock the SUT), you might be able to do that "before" the split to the DTS.COM (maybe by mocking it instead)

In any case I must say that I don't fully understand your situation. If you will be able to send an example solution we might be able to find some way of bypassing this issue. so let me know if you can and ill contact you offline.
answered by lior (13.2k points)
0 votes
Hi Lior.
I want to test my SUT.Net component.
The problem is that I can't create the component directly from my test.
My SUT.Net component is executed in the context of an DTS package as a custom transformation.
I think your approach 1. might work.
Add a test wrapping around the SUT.Net component in such a way that the DTS activates the new test enabled component.
Thanks
Arnulf
answered by krok (3.9k points)
...