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
0 votes

As VS2012 has made Fakes an ultimate only feature we are looking to migrate our existing moles/pex unit tests to Typemock. I would imagine this would be a natural transition for many users due to the pricing of VS2012.

If the Typemock community has any advice, guidance or tools from their experience converting to Typemock it would be greatly appreciated.
asked by daskinne (1.7k points)

3 Answers

0 votes

Unfortunately there is no tool for migrating test frmo Moles to Typemock.
How many tests do you have to migrate?
answered by alex (17k points)
0 votes
Hi Alex,

We have to convert approximately 75 test classes ranging from a few hundred lines to 1200 lines.

The problem as I see it is that Moles assemblies mock entire classes for each testset. These interfaces are then mocked more specifically at the start of the individual test. The format of the moles is much different than that of typemock as I understand it.

The stub implementation is also different.

A sample of these two main problems is included below, if you have any suggestions or experience migrating tests from moles please pass it on.

Assigning delegate to Servies Get Method of ServiceManager class.
       MServiceManager.ServicesGet = () =>
                    Services.Moles.MServiceManager.MServiceCollection services = new MServiceManager.MServiceCollection();

                    return services;

Creating a mock IComplexObject from the auto-generated moles/stubs assembly.
SIComplexObject view = new SIComplexObject();
answered by daskinne (1.7k points)
0 votes
Hello David,

I just sent you an email regarding this issue.
answered by NofarC (4k points)