Last Updated: 12 Sep 2019 12:51 by ADMIN

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 tests fail with a message pointing the integration between JustMock and the code coverage tool.
Last Updated: 12 Sep 2019 12:46 by ADMIN
Just like the core mocking API has ArrangeSet/AssertSet methods, so should the MockingContainer have them.
Last Updated: 22 Aug 2019 06:21 by ADMIN
Created by: Mihail
Comments: 0
Type: Feature Request
Implement support for executing JustMock tests on Linux
Last Updated: 19 Aug 2019 15:28 by ADMIN
The JutMock task for Azure Pipeline is missing the option to execute the tests with Visual Studio 2019. Check the attached screenshot.
Last Updated: 09 Jul 2019 11:14 by ADMIN
The JustMock profiler should be added to the commercial NuGet package distributed from the Telerik private NuGet server.
Last Updated: 18 Jun 2019 14:21 by ADMIN
The scenario includes two async tests executed synchronously. The first test doesn't have an await task call and in some random runs fails to call Mock.Reset. This messes the mocked objects of the second async test.
Last Updated: 05 Jun 2019 11:59 by ADMIN

Hi I have encountered what I think is a bug.

I would expected the following unit test to pass. It does not.

The example is distilled from a more complex case.

Is it not supported to have other threads create mocks?

[Fact] public async Task Fails() { var iTask = Task.Run(() => Mock.Create<I>()); var i = await iTask; EA expectedArgs = new EA(); EA receivedArgs = null; i.Done += (sender, ea) => receivedArgs = ea;

i.Raise(x => x.Done += null, expectedArgs); Assert.Equal(expectedArgs, receivedArgs); } public class EA : EventArgs { } public interface I { event EventHandler<EA> Done; }

Last Updated: 30 May 2019 08:38 by ADMIN

Let's have the following class and unit test:

public delegate Task<int> SomeDelegate();

public class Class1
    public async Task<int> ExecuteAsync(SomeDelegate next)
        Task<int> task1 = next.Invoke();
        int int1 = await DoSomeStuff();
        int int2 = await task1;
        return int1 + int2;

    private async Task<int> DoSomeStuff()
        await Task.Delay(100);
        return 1;

public async Task TestMethod1()
    // Arrange
    SomeDelegate next = Mock.Create<SomeDelegate>();
    next.Arrange(n => n.Invoke()).TaskResult(2).OccursOnce();
    // Act
    int sum = await new Class1().ExecuteAsync(next);

    // Assert
    Assert.AreEqual(3, sum);

JustMock public API lacks of convenient way to assert that particular task has been awaited. Potential workaround involves some "insider knowledge" that awaiting a Task internally results in a calls to some of its members.

Last Updated: 27 May 2019 15:18 by ADMIN
Mocking a method that is not used in the test execution logic could lead to unwanted recursive mocking behavior for the rest of the methods in the class. 
The unwanted behavior could later result in an exception if the affected methods are called during the arrangement of another method.
Last Updated: 01 Apr 2019 11:21 by ADMIN
Implement support for code coverage in the JustMock VSTest v.2 Azure Pipeline task similar to the code coverage option available in VS Test task.
Last Updated: 29 Mar 2019 14:25 by ADMIN
The JustMock tests are failing when the "Test platform version" option in the JustMock VSTest v.2 task is set to value "Installed by Tools Installer".
Last Updated: 12 Oct 2018 08:32 by Troy
Created by: Troy
Comments: 0
Type: Feature Request
Allow future mocking of an entire class, including a default of DoNothing() for all methods in the class, rather than requiring each method to be future mocked separately.
Last Updated: 08 Oct 2018 10:50 by ADMIN
Currently, there is no out of  the box support for passing "out" and "ref" parameters for nonpublic API.
Last Updated: 06 Aug 2018 07:41 by ADMIN
Asynchronous test execution might be run in a separate thread (it depends of the environment and it is completely transparent) which causes arrangements to lose their context. That is why the expected mocked return value for DateTime.UtcNow calls the original code and finally the test fails.
Last Updated: 23 Jul 2018 13:39 by Stefan
Last Updated: 23 Jul 2018 13:31 by Kaloyan
Current behavior:
Mock.Arrange(xxx).IgnoreInstance();    //mock all future instances of the type on which I set an expectation.

Feature Request:
Mock.Arrange(xxx).IgnoreInstance().Next();    //mock the next instance of the type on which I set an expectation.

...and even better...

Mock.Arrange(xxx).IgnoreInstance().Skip(3).Next();   //mock the 4th instance of a type on which I set an expectation.
Last Updated: 23 Jul 2018 13:16 by Stefan
I'm a user that is refactoring a legacy system which has a certain component to which I do not have the source. It uses COM interop heavily. I would like to be able to future-mock instances of RCW's so that I can write tests for that component.
Last Updated: 23 Jul 2018 13:10 by Stefan
Created by: Stefan
Comments: 0
Type: Feature Request
I'd like to be able to intercept and arrange access to fields on any class.

public class Dependency
  public int A;
var dep = new Dependency();
Mock.Arrange(() => dep.A).Returns(5);
Mock.ArrangeSet(() => dep.A = Arg.AnyInt).DoInstead(...);
Last Updated: 23 Jul 2018 13:04 by ADMIN
Created by: Vladi
Comments: 0
Type: Feature Request
Integrate with Simple Injector: similar to and
Last Updated: 23 Jul 2018 12:55 by Brian
Created by: Brian
Comments: 0
Type: Feature Request
Any plans to support Windows 10 UWP/UAP projects? I tried the existing version but ran into several roadblocks:

Attempt #1 (does not work):
Cannot add JustMockLite to a Windows 10 Unit Test project via NuGet because UAP projects are not supported.

Attempt #2 (does not work)
Add a reference to the pre-compiled binaries. The Win10 project allows the reference, but when the tests run, it results in a bunch of 'Could not find assembly System.Core v3.5.0.0' exceptions. Tried installing .Net 3.5 but didnt help. Tried building from source and retargeting the framework to 4, 4.5, 4.5.2, and 4.6, but that didnt work (see Attempt #3).
Just a note: when Visual Studio 2015 was in RC status, we had this working. We simply added a reference to the pre-compiled Telerik.JustMocks assembly and things worked. Updating to VS RTM though broke things.

Attempt #3 (does not work)
Compile JustMockLite from source.  VS complains that the Win10 Unit Test project is of type NetCore and the JustMock assembly targets NetFramework.

Attempt #4 (does not work)
Add reference to Telerik.JustMock.Portable to Windows 10 Unit Test project. This allows the project to compile and run, but any tests using Mock.Create() fail because System.Diagnostics.StackTrace.ctor is not supported.

1 2