In Development
Last Updated: 17 Nov 2020 12:46 by ADMIN
Created by: Eric
Comments: 6
Type: Bug Report
0

when using JustMock Free in a net 5.0 app.  I am getting an Ninject exception that IAssemblyNameRetriever could not be found.  Looking at the code on github,

the NETCORE compile constant removes the line

AddComponent<IAssemblyNameRetriever, AssemblyNameRetriever>();

from StandardKernel.cs

however, CompiledModuleLoaderPlugin uses IAssemblyNameRetriever in it's constructor and

AddComponent<IModuleLoaderPlugin, CompiledModuleLoaderPlugin>();

is still included in the NETCORE version.

 

 

In Development
Last Updated: 21 Oct 2020 09:34 by ADMIN
Created by: Mihail
Comments: 2
Type: Feature Request
0
JustMock should support .NET 5
In Development
Last Updated: 20 Oct 2020 10:17 by ADMIN

I have a class, which has a private async method, which has a local function, like the following example

 

internal class TestClass

{

 ......

        private async Task<bool> TestPrivateMethod()
        {
            var x = await TestLocalFunction();
            return x;

            async Task<bool> TestLocalFunction()
            {
                await Task.Delay(5);
                return true;
            }
 }

 

When I try to mock the local function, thows an error "System.MissingMemberException : C# 7 local function 'TestLocalFunction' with the given signature was not found inside method 'TestPrivateMethod'"

 

var testClassInstance = Mock.Create<TestClass>(Behavior.CallOriginal);

Mock.Local.Function.Arrange<Task<bool>>(testClassInstance, "TestPrivateMethod", "TestLocalFunction").Returns(Task.FromResult(true));