Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placeholder in exception is not filled out #1246

Closed
abatishchev opened this issue Mar 20, 2022 · 0 comments · Fixed by #1247
Closed

Placeholder in exception is not filled out #1246

abatishchev opened this issue Mar 20, 2022 · 0 comments · Fixed by #1247
Labels
Milestone

Comments

@abatishchev
Copy link
Contributor

abatishchev commented Mar 20, 2022

Here's an exception I'm getting:

[INFO] [35]   Error Message:
[INFO] [36]    Test method Throttle.Client.Tests.ThrottleClientTests.TestLocalAggregationClient threw exception: 
[INFO] [37] System.ArgumentException: Type to mock ({0}) must be an interface, a delegate, or a non-sealed, non-static class. ---> System.TypeLoadException: Method 'RemoveExpiredIdentifiers' on type 'Castle.Proxies.LocalAggregationClientProxy' from assembly 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=a621a9e7e5c32e69' is overriding a method that is not visible from that assembly.
[INFO] [38]   Stack Trace:
[INFO] [39]       at System.Reflection.Emit.TypeBuilder.TermCreateClass(RuntimeModule module, Int32 tk, ObjectHandleOnStack type)
[INFO] [40]    at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
[INFO] [41]    at System.Reflection.Emit.TypeBuilder.CreateTypeInfo()
[INFO] [42]    at Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.CreateType(TypeBuilder type)
[INFO] [43]    at Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.BuildType()
[INFO] [44]    at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateType(String name, Type[] interfaces, INamingScope namingScope)
[INFO] [45]    at Castle.Core.Internal.SynchronizedDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
[INFO] [46]    at Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey cacheKey, Func`3 factory)
[INFO] [47]    at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors)
[INFO] [48]    at Moq.CastleProxyFactory.CreateProxy(Type mockType, IInterceptor interceptor, Type[] interfaces, Object[] arguments) in C:\projects\moq4\src\Moq\Interception\CastleProxyFactory.cs:line 62
[INFO] [49] --- End of inner exception stack trace ---
[INFO] [50]     at Moq.CastleProxyFactory.CreateProxy(Type mockType, IInterceptor interceptor, Type[] interfaces, Object[] arguments) in C:\projects\moq4\src\Moq\Interception\CastleProxyFactory.cs:line 66
[INFO] [51]    at Moq.Mock`1.InitializeInstance() in C:\projects\moq4\src\Moq\Mock`1.cs:line 304
[INFO] [52]    at Moq.Mock`1.OnGetObject() in C:\projects\moq4\src\Moq\Mock`1.cs:line 326
[INFO] [53]    at Moq.Mock`1.get_Object() in C:\projects\moq4\src\Moq\Mock`1.cs:line 281
[INFO] [54]    at ClientTests.TestLocalAggregationClient() in C:\source\src\ThrottleClientTests.cs:line 1251
[INFO] [55] Results File: C:\source\TestResults\ContainerAdministrator_656F1E5836B3_2022-03-20_23_04_12.trx

Note the placeholder {0} that wasn't filled out a value:

System.ArgumentException: Type to mock ({0}) must be an interface, a delegate, or a non-sealed, non-static class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants