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
Hello,

A number of tests we have which previously passed with Typemock 6.0.10 in VS2010, no longer pass with Typemock 7.1.2 in VS2012. The error description is detailed below. The unit test and code it tests has not changed between versions of Typemock. As far as I'm aware, ConfigurationManager is in System.Configuration.dll.

*Edit* This has now been tested in VS2010, Typemock 7.1.2 and the tests pass, so only affecting VS2012. *Edit*

The line it does not like is:
KeyValueConfigurationCollection collection = new KeyValueConfigurationCollection();

Isolate.WhenCalled(() => ConfigurationManager.OpenMachineConfiguration().AppSettings.Settings)
.WillReturn(collection);


Test Name: TestUnityContainerHeirachyTestInterfaceTwoFirst
Test Outcome: Failed
Test Duration: 0:00:00.0078852

Result Message:
Test method TestUnityContainerHeirachyTestInterfaceTwoFirst threw exception:
TypeMock.TypeMockException:
*** Can not fake methods defined in mscorlib, try faking the defining type
Result StackTrace:
at ik.b(Object A_0)
at ik.d(Object A_0)
at ik.c.a()
at ik.a(Object A_0, Boolean A_1, Func`1 A_2, Action A_3, Action A_4, Action A_5, Boolean A_6)
at ik.e(Object A_0)
at TypeMock.ArrangeActAssert.ExpectationEngine`1.a(TResult A_0)
at <Our test file>


Many thanks,

John
asked by Slavo (2.4k points)

5 Answers

0 votes
Hello,

I would be grateful if someone could acknowledge my bug request. As a multi-license customer with support I would expect a more timely response and for requests to be at least visited in the order they were raised.

Is this the only means of accessing your support?

Kind regards,

John Westdorp (EDevelopment Ltd.)
answered by Slavo (2.4k points)
0 votes
Hello John,

Sorry for the late reply.
We are looking into this issue, and I will update you as soon as possible.
answered by NofarC (4k points)
0 votes
Hi John,


I tried to run the lines which cause the exception on your machine but it runs fine.
Can you please send us a small reproduction project that demonstrates this behavior?

You can send it here or via mail.
answered by NofarC (4k points)
0 votes
Dear Nofar,

The unit test I raised this issue against has now produced a different output having fixed a separate test in an unrelated project (within the same solution).

The test I fixed was complaining of a missing file in the output folder. This was being caused by a merge issue in the supporting app.config file for that test project (we use Unity). The merge process replaced each carriage return in the app.config file with "&#xD;&#xA;". Having corrected this, it complained of 1 (of several) entry within our mapperDictionary declaration was only using partial binding (they all are). Whilst this is peculiar, I proceeded to update it which caused that test to pass and the originally reported failing test now outputs an updated failure message:

Test Name: TestUnityContainerHeirachyTestInterfaceTwoFirst
Test Outcome: Failed
Test Duration: 0:00:12.0858207

Result Message:
TestUnityContainerHeirachyTestInterfaceTwoFirst threw exception:
System.NullReferenceException: Object reference not set to an instance of an object.
Result StackTrace: at TypeMock.MockPainter.ShouldPaint(String typename, String method, Object context, TypeParams genericTypes)

I shall continue to investigate further and will report back with my findings and we can go from there.

May I thank you for taking a look at what I provided and apologise that it was not enough to reproduce the bug we are experiencing and being unable to provide the source which would reproduce it as there is far too much!

Thanks again,

John
answered by Slavo (2.4k points)
0 votes
Hello John,

Thank you for updating us.

Please contact us whenever our assistance is needed.
answered by NofarC (4k points)
...