We're developing .net 5/core services, using Rider IDE and MacOS.
Please:
1. Add support to run JustMock under MacOS (profiler need to be supported, enabled issue, etc.), or if already supported, please provide instructions of how to activate it per test, for example using NUnit.
2. Add integration with Rider so all the process will be much easier.
C# 8 introduces default interface method implementations. Attempt to mock such methods with JustMock in elevated mode fails. The following example illustrates the issue:
public interface IMyInterface
{
int IntProperty { get => 0; }
}
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
var mock = Mock.Create<IMyInterface>();
Mock.Arrange(() => mock.IntProperty).Returns(1);
Assert.AreEqual(1, mock.IntProperty);
}
}
The issue is present when JustMock extension is installed and the debugger is launched inside unrelated projects, for example, a blank console app. The extension should detect JustMock references from project settings and automatically disable this feature when it becomes inapplicable. Optionally the extension could give the way to explicitly disable the debug window from popping up by toggling the menu item.
Currently, when the JustMock profiler is enabled it provides a performance hit on the test execution. This effect is expected because a profiler is involved.
What we can do is find a more optimized way of instrumenting the methods.
Currently, the support for code coverage in the JustMock Azure Pipeline task includes only projects targeting .NET Framework.
Implement support for projects targeting .NET Core.
Currently, there are a lot of JustMock project templates with different targeted categories. There are templates targeting just one search category and there are other templates targeting different categories.
Optimize the templates to be available in all relevant search categories and lower their number.
Implement integration between JustMock and the code coverage provided by Visual Studio for .net core applications.
Steps representing the missing feature:
Create a .net core test project.
Include JustMock tests.
Execute the tests with code coverage provided by Visual Studio Enterprise.
The CallMethod of the PrivateAccessor is using reflection to invoke the required method. When an exception is thrown inside that method it will be wrapped by the reflection in a TargetInvocationException which is received in the test method.
Instead of the TargetInvocationException, throw the original exception.