We have installed TypeMock 5.4.5, and several tests failed with strange TypeMock exceptions that we did not observe before.
Unfortunately the project is large, so I can't extract a small example that reproduces behavior, but here's what happens:
1. We have a test called GetCodeTables_ValidData_success.
2. In "arrange" part of test we fake a few objects
3. Test code makes a call to a method GetCodeTables
4. Inside GetCodeTables there is a following code:
Predicate<CpCurrencyInfo> predicate = c => c.CurrencyCode.Equals(responseCountryInfo.baseReceiveCurrency, StringComparison.InvariantCultureIgnoreCase);
var baseReceiveCurrency = currencyInfos.Find(predicate);
Attempt to execute this code fails with the following exception:
*** No method with name <GetCodeTables in type Contopronto.Connectors.MoneyGram.CpMoneyGramConnector exists.
at cn.b(Type A_0, String A_1)
at cn.c(Type A_0, String A_1)
at ce.a(String A_0, Object[] A_1, Object A_2, Object A_3, String A_4, Type A_5)
at c8.a(String A_0, Object A_1, MethodBase A_2, Object[] A_3, Object A_4, String A_5, ce A_6)
at c8.b(Object A_0, String A_1, String A_2, MethodBase A_3, Object[] A_4, Object A_5)
C:ProjectsTfs2008LuupTxpMainNETConnectorsMoneyGramManagerCpMoneyGramConnector.cs(1285,0): at Contopronto.Connectors.MoneyGram.CpMoneyGramConnector.<>c__DisplayClassc.<GetCodeTables>b__5(CpCurrencyInfo c)
at System.Collections.Generic.List`1.Find(Predicate`1 match)
C:ProjectsTfs2008LuupTxpMainNETConnectorsMoneyGramManagerCpMoneyGramConnector.cs(1368,0): at Contopronto.Connectors.MoneyGram.CpMoneyGramConnector.GetCodeTables()
C:ProjectsTfs2008LuupTxpMainNETConnectorsMoneyGramManagerTestsUnitCpMoneyGramConnectorTests.cs(1467,0): at Contopronto.Connectors.MoneyGram.Tests.Unit.CpMoneyGramConnectorTests.GetCodeTables_ValidData_success()
at TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Object[] A_5)
at TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected)
C:ProjectsTfs2008LuupTxpMainNETConnectorsMoneyGramManagerTestsUnitCpMoneyGramConnectorTests.cs(0,0): at Contopronto.Connectors.MoneyGram.Tests.Unit.CpMoneyGramConnectorTests.GetCodeTables_ValidData_success()
It looks like newest version of TypeMock has a problem with interpreting method name in the line
Contopronto.Connectors.MoneyGram.CpMoneyGramConnector.<>c__DisplayClassc.<GetCodeTables>b__5(CpCurrencyInfo c)
Apparently it expects a method name <GetCodeTables, prefixed with angle bracket which is of coure wrong.
Everything worked fine with previous Isolator version.