Not sure if this is an XUnit.Net or JustMock (or both) issue. I have several tests on a solution that run and show passed but grayed out after a test run or build. VS2017 shows "Unexpected error detected. Check the Tests Output Pane for details. The Test Output pane has a dump (see below). The tests when run individually seem to pass and generate no errors, only when "Run All Tests" or as a result of a Build (run all tests after build set) do you see several tests grayed out. It's always the same four tests. Three have JustMock objects, one does not.
VS2017 Enterprise 15.2 (26430.12)
JustMock 2017.2.5303.3 (internal build to fix the 2017 profiler item)
This might be an internal build issue which is why I'm not logging it as a ticket, but thought I'd throw this in here to let you know about it.
------ Run test started ------
[xUnit.net 00:00:00.2643557] Discovering: UnitTests
[xUnit.net 00:00:01.0713800] Discovered: UnitTests
[xUnit.net 00:00:01.4834782] Starting: UnitTests
[xUnit.net 00:00:03.0127894] [FATAL ERROR] System.ArgumentException
[xUnit.net 00:00:03.0171999] System.ArgumentException :
'this'
type cannot be an
interface
itself.
[xUnit.net 00:00:03.0198958] Stack Trace:
[xUnit.net 00:00:03.0207009]
[xUnit.net 00:00:03.0214322] Server stack trace:
[xUnit.net 00:00:03.0221175] at System.RuntimeTypeHandle.VerifyInterfaceIsImplemented(RuntimeTypeHandle handle, RuntimeTypeHandle interfaceHandle)
[xUnit.net 00:00:03.0227770] at System.RuntimeTypeHandle.VerifyInterfaceIsImplemented(RuntimeTypeHandle interfaceHandle)
[xUnit.net 00:00:03.0232817] at System.RuntimeType.GetInterfaceMap(Type ifaceType)
[xUnit.net 00:00:03.0239207] at Telerik.JustMock.Core.MockingUtil.IsImplementedBy(MethodInfo interfaceMethod, MethodBase implMethod)
[xUnit.net 00:00:03.0243577] at Telerik.JustMock.Core.Context.HierarchicalTestFrameworkContextResolver.MatchTestClassDispose(MethodBase method, String[] testMethodAttributes)
[xUnit.net 00:00:03.0249418] at Telerik.JustMock.Core.Context.HierarchicalTestFrameworkContextResolver.<>c__DisplayClass31.<SetupStandardHierarchicalTestStructure>b__1f(MethodBase method)
[xUnit.net 00:00:03.0255662] at Telerik.JustMock.Core.Context.HierarchicalTestFrameworkContextResolver.<>c__DisplayClassa.<FindTestMethod>b__9(RepositoryOperationsBase repo)
[xUnit.net 00:00:03.0261179] at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
[xUnit.net 00:00:03.0266557] at Telerik.JustMock.Core.Context.HierarchicalTestFrameworkContextResolver.<FindTestMethod>b__8(MethodBase method)
[xUnit.net 00:00:03.0271733] at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
[xUnit.net 00:00:03.0276714] at System.Linq.Enumerable.<DistinctIterator>d__63`1.MoveNext()
[xUnit.net 00:00:03.0281930] at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
[xUnit.net 00:00:03.0286994] at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
[xUnit.net 00:00:03.0292425] at Telerik.JustMock.Core.Context.HierarchicalTestFrameworkContextResolver.FindTestMethod(Int32& repoIdx, RepositoryOperationsBase& entryOps)
[xUnit.net 00:00:03.0297270] at Telerik.JustMock.Core.Context.HierarchicalTestFrameworkContextResolver.ResolveRepository(UnresolvedContextBehavior unresolvedContextBehavior)
[xUnit.net 00:00:03.0301511] at Telerik.JustMock.Core.Context.MockingContext.ResolveRepository(UnresolvedContextBehavior unresolvedContextBehavior)
[xUnit.net 00:00:03.0305562] at Telerik.JustMock.Core.MocksRepository.GetMockMixin(Object obj, Type objType)
[xUnit.net 00:00:03.0309488] at Telerik.JustMock.Core.Invocation..ctor(Object instance, MethodBase method, Object[] args)
[xUnit.net 00:00:03.0313652] at Telerik.JustMock.Core.ProfilerInterceptor.InterceptCall(RuntimeTypeHandle typeHandle, RuntimeMethodHandle methodHandle, Object[] data)
[xUnit.net 00:00:03.0318462] at System.MarshalByRefObject.GetIdentity(MarshalByRefObject obj, Boolean& fServer)
[xUnit.net 00:00:03.0323720] at System.Runtime.Remoting.IdentityHolder.FindOrCreateServerIdentity(MarshalByRefObject obj, String objURI, Int32 flags)
[xUnit.net 00:00:03.0328321] at System.Runtime.Remoting.RemotingServices.GetOrCreateIdentity(MarshalByRefObject Obj, String ObjURI, Boolean isInitializing)
[xUnit.net 00:00:03.0363414] at System.Runtime.Remoting.RemotingServices.MarshalInternal(MarshalByRefObject Obj, String ObjURI, Type RequestedType, Boolean updateChannelData, Boolean isInitializing)
[xUnit.net 00:00:03.0369562] at System.Runtime.Remoting.RemotingServices.MarshalInternal(MarshalByRefObject Obj, String ObjURI, Type RequestedType, Boolean updateChannelData)
[xUnit.net 00:00:03.0375367] at System.Runtime.Remoting.RemotingServices.MarshalInternal(MarshalByRefObject Obj, String ObjURI, Type RequestedType)
[xUnit.net 00:00:03.0381086] at System.Runtime.Remoting.Messaging.MessageSmuggler.FixupArg(Object arg, ArrayList& argsToSerialize)
[xUnit.net 00:00:03.0386417] at System.Runtime.Remoting.Messaging.MessageSmuggler.FixupArgs(Object[] args, ArrayList& argsToSerialize)
[xUnit.net 00:00:03.0390906] at System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage..ctor(IMethodCallMessage mcm)
[xUnit.net 00:00:03.0395394] at System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.SmuggleIfPossible(IMessage msg)
[xUnit.net 00:00:03.0400477] at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)
[xUnit.net 00:00:03.0404910]
[xUnit.net 00:00:03.0408806] Exception rethrown at [0]:
[xUnit.net 00:00:03.0412930] at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
[xUnit.net 00:00:03.0417710] at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
[xUnit.net 00:00:03.0623429] [FATAL ERROR] System.ArgumentException
[xUnit.net 00:00:03.0998317] [FATAL ERROR] System.ArgumentException
[xUnit.net 00:00:04.3804395] Finished: UnitTests
========== Run test finished: 35 run (0:00:04.5228864) ==========