All right... Time passed, now I've got over 6000 tests now and this bug became very annoying.
Every nightly build fails now with at least one "***Internal..." but now I can say about the error pattern: it always happens in LINQs.
For example, from today's build I've got following broken test (here is one but I've got 6 tests failed with "***Internal...")
[TestMethod]
[IntegrationTest]
public void IntegrationTest_GetGeoTypes()
{
#region Expected Result
IList<GeoType> expectedResult = new List<GeoType>()
{
new GeoType()
{
Id = 13,
Name = "name1",
Scope = 3
},
new GeoType()
{
Id = 23,
Name = "name2",
Scope = 4
}
};
#endregion
string userName = "IntegrationTest_GetSegmentDescription";
AddressManagementDBAccessor accessor = new AddressManagementDBAccessor();
IList<GeoType> actualResult;
using (SessionProxy session = IntegrationTestsDBConnection.GetSessionForIntegrationTest()) -- session is mocked here
{
session.Open(System.Data.IsolationLevel.ReadCommitted, userName);
actualResult = accessor.GetGeoTypes(session);
}
//Verify
VerifyHelpers.CheckValues<GeoType>(expectedResult[0], actualResult.Where(entity => entity.Id == 13).Single(), "13"); -- Fails here
VerifyHelpers.CheckValues<GeoType>(expectedResult[1], actualResult.Where(entity => entity.Id == 23).Single(), "23");
}
Test method Wumte.Server.Common.UnitTests.AddressManagementDBAccessorTest.IntegrationTest_GetGeoTypes threw exception:
TypeMock.TypeMockException:
*** Internal Error mocked value not found
dq.a()
dq.a(Object A_0, String A_1, String A_2, MethodBase A_3, Object[] A_4, Object A_5)
Wumte.Server.Common.UnitTests.AddressManagementDBAccessorTest.<IntegrationTest_GetGeoTypes>b__17(GeoType entity) in c:BuildRootBifrostAndvari NightlySourcesWumte.Server.Common.UnitTestsAddressManagementDBAccessorTest.cs: line 172
System.Linq.Enumerable.WhereListIterator`1.MoveNext()
System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
Wumte.Server.Common.UnitTests.AddressManagementDBAccessorTest.IntegrationTest_GetGeoTypes() in c:BuildRootBifrostAndvari NightlySourcesWumte.Server.Common.UnitTestsAddressManagementDBAccessorTest.cs: line 172
TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Boolean A_5, Object[] A_6)
TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected, Boolean isInterceptedType)
Wumte.Server.Common.UnitTests.AddressManagementDBAccessorTest.IntegrationTest_GetGeoTypes() in c:BuildRootBifrostAndvari NightlySourcesWumte.Server.Common.UnitTestsAddressManagementDBAccessorTest.cs: line 138
VerifyHelpers.CheckValues is method which we wrote for comparing expected and actual collections:
public static void CheckValues<TResult>(TResult expected, TResult actual, string id, params string[] ignore)
{
Assert.IsNotNull(expected, "expected value is null");
Assert.IsNotNull(actual, "actual value is null");
var properties = EntityHelper.GetSimpleProperties<TResult>()
.Where(property => !ignore.Contains(property.Name, new EqualityComparerFunc<string>((str1, str2) => string.Equals(str1, str2, StringComparison.InvariantCultureIgnoreCase))));
/*System.Diagnostics.Debug.WriteLine(string.Empty);
System.Diagnostics.Debug.WriteLine(string.Format("CheckValues<0>", typeof(TResult)));*/
foreach (var property in properties)
{
/*System.Diagnostics.Debug.WriteLine(string.Format("Name {0} expected {1} actual {2}", property.Name, property.GetValue(obj1, null), property.GetValue(obj2, null)));*/
Assert.AreEqual(property.GetValue(expected, null), property.GetValue(actual, null), "Entity " + typeof(TResult) + " id[" + id + "]: " + property.Name);
}
}
The main problem is the exception occures when there are a lot of tests in test-run. I can't reproduce it running only this test but in test-run of 6000 tests this one fails almost every time
BTW - why Isolator is wrapping something in LINQ methods I don't mock?
Isolator 6.0.10
Thanks in advance