In Development
Last Updated: 21 Mar 2019 17:37 by ADMIN
Created by: Marcel
Comments: 0
Type: Bug Report
0
Basically calling Mock.Reset at the end of the method is not safe.
It seems like the the way JustMock iterates over an IEnumerable is not correct.
Log:
2019-01-25T09:23:53.9254819Z Warning: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
2019-01-25T09:23:53.9254819Z    at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
2019-01-25T09:23:53.9254819Z    at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
2019-01-25T09:23:53.9254819Z    at Telerik.JustMock.Core.MocksRepository.CopyConfigurationFromParent()
2019-01-25T09:23:53.9254819Z    at Telerik.JustMock.Core.MocksRepository.Reset()
2019-01-25T09:23:53.9254819Z    at Telerik.JustMock.Core.Context.HierarchicalTestFrameworkContextResolver.RepositoryOperationsStrongRef.RetireRepository(Object key, MocksRepository repo)
2019-01-25T09:23:53.9254819Z    at Telerik.JustMock.Core.Context.HierarchicalTestFrameworkContextResolver.FindRepositoryInOps(RepositoryOperationsBase entryOps, Object entryKey)
2019-01-25T09:23:53.9254819Z    at Telerik.JustMock.Core.Context.HierarchicalTestFrameworkContextResolver.RetireRepository()
2019-01-25T09:23:53.9254819Z    at Telerik.JustMock.Core.Context.MockingContext.RetireRepository()
2019-01-25T09:23:53.9254819Z    at Telerik.JustMock.Core.ProfilerInterceptor.GuardInternal(Action guardedAction)
2019-01-25T09:23:53.9254819Z    at Sap.Tests.<MyTests_DoAsync_ReturnTrue>d__26.MoveNext() in E:\Builds\_work\9\s\Tests\MyTests.cs:line 476
2019-01-25T09:23:53.9254819Z    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
2019-01-25T09:23:53.9254819Z    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
2019-01-25T09:23:53.9410972Z    at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
2019-01-25T09:23:53.9410972Z    at System.Threading.ThreadPoolWorkQueue.Dispatch()
2019-01-25T09:23:53.9410972Z    at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
2019-01-25T09:23:53.9410972Z    at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
2019-01-25T09:23:53.9410972Z    at Telerik.JustMock.Core.MocksRepository.CopyConfigurationFromParent()
2019-01-25T09:23:53.9410972Z    at Telerik.JustMock.Core.MocksRepository.Reset()
2019-01-25T09:23:53.9410972Z    at Telerik.JustMock.Core.Context.HierarchicalTestFrameworkContextResolver.RepositoryOperationsStrongRef.RetireRepository(Object key, MocksRepository repo)
2019-01-25T09:23:53.9410972Z    at Telerik.JustMock.Core.Context.HierarchicalTestFrameworkContextResolver.FindRepositoryInOps(RepositoryOperationsBase entryOps, Object entryKey)
2019-01-25T09:23:53.9410972Z    at Telerik.JustMock.Core.Context.HierarchicalTestFrameworkContextResolver.RetireRepository()
2019-01-25T09:23:53.9410972Z    at Telerik.JustMock.Core.Context.MockingContext.RetireRepository()
2019-01-25T09:23:53.9410972Z    at Telerik.JustMock.Core.ProfilerInterceptor.GuardInternal(Action guardedAction)
2019-01-25T09:23:53.9410972Z    at Sap.Tests.<MyTests_DoAsync_ReturnTrue>d__26.MoveNext() in E:\Builds\_work\9\s\Tests\MyTests.cs:line 476
2019-01-25T09:23:53.9410972Z    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
2019-01-25T09:23:53.9410972Z    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
2019-01-25T09:23:53.9410972Z    at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
2019-01-25T09:23:53.9410972Z    at System.Threading.ThreadPoolWorkQueue.Dispatch()
In Development
Last Updated: 21 Mar 2019 17:37 by ADMIN
Mocking an async calls alse triggers hidden mocking of the return type. Depending of the type it might cause unexpected behavior or exception.
In Development
Last Updated: 25 Feb 2019 08:55 by ADMIN
Docker is a container acting like an isolated environment. Research how the JustMock profiler can be registered into such container.
Hosted VSTS should work on the same principle. Research how the registry could be accessed through VSTS extension or other tools.