Sellorio / JazSharp

Jasmine inspired mocking and unit testing framework for C#.
Apache License 2.0
66 stars 4 forks source link

Interface return types cause "Cannot create an instance of an interface." #10

Closed Sellorio closed 5 years ago

Sellorio commented 5 years ago

at RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor) at RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean skipCheckThis, Boolean fillCache) at Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions) at SpyBehaviourBase.GetDefaultValue(Type type) in SpyBehaviourBase.cs line: 53 at SpyBehaviourBase.Execute(Spy spy, MethodInfo exactMethod, Object instance, Object[] parameters) in SpyBehaviourBase.cs line: 33 at SpyExecutionHelper.InnerHandleCall(Spy spy, MethodInfo method, Object instance, Object[] parameters) in SpyExecutionHelper.cs line: 74 at SpyExecutionHelper.HandleCall(Object[] parameters, MethodBase originalMethod) in SpyExecutionHelper.cs line: 38 at SpyEntryPoints.Func0[TR](MethodBase originalMethod) in SpyEntryPoints.cs line: 98 at <.ctor>b__0_2() in YieldReturnSpec.cs line: 21 at TestRun.TestExecutionAsync(Test test, Boolean onlyFocused) in TestRun.cs line: 161

This is already fixed in commit https://github.com/Sellorio/JazSharp/commit/1532cfeaa03146add0d77cffe75a9d4f1ad0122c. The issue has been created to avoid duplicates before Beta 3 is released.