Unplanned
Last Updated: 10 May 2023 08:22 by ADMIN
ADMIN
Created by: Kamen Ivanov
Comments: 3
Category: JustMock
Type: Feature Request
5

			
Unplanned
Last Updated: 12 Oct 2018 08:32 by Troy
Created by: Troy
Comments: 0
Category: JustMock
Type: Feature Request
3
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.
Unplanned
Last Updated: 25 Jun 2020 14:08 by ADMIN
Created by: Mihail
Comments: 0
Category: JustMock
Type: Feature Request
3
Currently, the JustMock tests are failing when the Live Unit testing functionality is started. JustMock should provide integration for the Visual Studio Live Unit testing functionality.
Unplanned
Last Updated: 25 Feb 2025 12:24 by ADMIN
Created by: Maria
Comments: 0
Category: JustMock
Type: Feature Request
3
Currently, the JustMock extension does not work on ARM64 machines with Visual Studio 2022 v17.4 and later.
Unplanned
Last Updated: 07 Oct 2021 14:06 by ADMIN
Created by: Alan
Comments: 4
Category: JustMock
Type: Feature Request
2
I am in the process of building an internal developer platform on kubernetes. Historically, in order to run justmock on build servers we pointed to a special location of the windows registry for accessing the DLL. In kubernetes, the build runners are kubernetes nodes. Is there a preferred way to run these tests in this environment? I can provide more details if it is helpful or valuable. Historically, we used Azure Devops build agents in this new world dotnet test is being run in Linux gitlab agents and not windows. I would have chosen linux in the dropdown but wasn't available.
Unplanned
Last Updated: 05 Jun 2019 11:59 by ADMIN
Created by: Kim
Comments: 5
Category: JustMock
Type: Feature Request
1

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; }


Unplanned
Last Updated: 03 Jan 2023 16:56 by ADMIN
Created by: Mihail
Comments: 2
Category: JustMock
Type: Feature Request
1
Consider the scenario where a class has a string field which is his main data. This class has defined an implicit cast operator to string. When that cast operator is executed the resulted string will contain the value from the class field.

Implement support for mocking of an operator such as the one described. 
Unplanned
Last Updated: 01 Dec 2021 14:06 by ADMIN
Created by: Ivo
Comments: 0
Category: JustMock
Type: Feature Request
1
Coverlet (https://github.com/coverlet-coverage/coverlet) is a cross-platform .NET code coverage tool, so the integration should be considered for all currently (and also potentially) supported platforms by JustMock.
Unplanned
Last Updated: 04 Jul 2022 11:41 by Ivo
Created by: Ivo
Comments: 0
Category: JustMock
Type: Feature Request
1

The threading model of UI apps differs from the test host and this might become a source of issues like the following: System.InvalidOperationException: "The calling thread must be STA, because many UI components require this". The request is about extending JustMock with some helpers that can be used to solve this issue easily.

Unplanned
Last Updated: 10 Nov 2022 09:40 by Ivo
Mocking of these methods could not be made due to compiler (CS8175) or runtime (System.InvalidProgramException: Cannot create boxed ByRef-like values) errors.
Unplanned
Last Updated: 25 Jan 2023 10:55 by Ivo

Considering the following simple test scenario:

public abstract class TestBase
{
    public static TestContext TestContext { get; set; }
}

[TestClass]
public class UnitTest1 : TestBase
{
    [ClassInitialize]
    public static void ClassInitlialize(TestContext ctx)
    {
        TestContext = ctx;
    }

    [TestMethod]
    public void TestMethod1()
    {

    }
}

[TestClass]
public class UnitTest2 : TestBase
{
    [ClassInitialize]
    public static void ClassInitlialize(TestContext ctx)
    {
        TestContext = ctx;
    }

    [TestMethod]
    public void TestMethod1()
    {

    }
}

Attempt to run the tests above with JustMock profiler enabled fails with System.InvalidProgramException. The issue is not reproducible with MSTest.TestFramework and MSTest.TestAdapter packages prior to 3.0.x.

 

Unplanned
Last Updated: 25 Apr 2023 15:53 by Ivo
Created by: Ivo
Comments: 0
Category: JustMock
Type: Feature Request
1

JustMock interprets anonymous types as tuples. The sample below demonstrates the issue:

public interface IAnsweringService
{
    (int code, string desc) GetAnswer(string question);
}


[TestMethod]
public void AnswerToTheUniverseQuestionTest()
{
    var apiMock = Mock.Create<IAnsweringService>();

    var expectedAnswer = new { code = 42, desc = "Answer to the Ultimate Question of Life" };

    Mock.Arrange(() => apiMock.GetAnswer(Arg.AnyString)).Returns(expectedAnswer);

    var actualAnswer = apiMock.GetAnswer("What is a universe question answer?");

    Assert.AreEqual(expectedAnswer.code, actualAnswer.code);
    Assert.AreEqual(expectedAnswer.desc, actualAnswer.desc);
}
The test fails with error:

Telerik.JustMock.Core.MockException: The chained return value type '<>f__AnonymousType1`2[System.Int32,System.String]' is not compatible with the arranged method's return type 'System.ValueTuple`2[System.Int32,System.String]'

Unplanned
Last Updated: 16 May 2024 09:48 by ADMIN
Created by: Yosi
Comments: 4
Category: JustMock
Type: Feature Request
1

Hi.

i saw this: https://www.telerik.com/forums/how-can-i-mock-multiple-instances-of-a-struct

but still dont understand why JustMock works that way in the first place. why does it union struct mocks by value?

the above solution is only possible when i mock a struct i can change (and then add the id to it) but what about struct's from the framework that i cannot control? Is there a way to tell JustMock not to union mock structs?

Thanks,

Yosi

Unplanned
Last Updated: 30 Nov 2023 08:54 by Christian
Created by: Ivo
Comments: 1
Category: JustMock
Type: Feature Request
1
This request is about making feature parity with the existing functionality that currently supports C#.
Unplanned
Last Updated: 29 Jul 2025 11:07 by ADMIN
Scheduled for 2025 Q4
Created by: Ivo
Comments: 0
Category: JustMock
Type: Bug Report
1

To replicate the problem using the provided project, follow these steps:

1. Open the solution in Rider.
2. Set breakpoints at the beginning of the test.
3. Start debugging the test.
4. Step into the constructor of the Car class and inspect the contents of the array. Note that if this step is skipped, the issue will not be reproducible.
5. Step out of the constructor.
6. Continue execution until just before calling the virtual function for the Number property.
7. Step into the function.

**EXPECTED** The value of Name should be visible.

**ACTUAL** A debugger error occurs.

The issue can appear in both Visual Studio (showing "Internal error in the C# compiler") and Rider (showing "Read out of bounds"). 


Unplanned
Last Updated: 23 Jul 2018 13:31 by Kaloyan
Created by: Kaloyan
Comments: 0
Category: JustMock
Type: Feature Request
0
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.
Unplanned
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.
Unplanned
Last Updated: 30 May 2019 08:38 by ADMIN
Created by: Robert
Comments: 0
Category: JustMock
Type: Feature Request
0

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;
    }
}

[TestMethod]
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
    Mock.Assert(next);
    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.

Unplanned
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.
Unplanned
Last Updated: 26 Nov 2019 10:08 by ADMIN
.Net for application developers prefer writing their build script using cake. It is necessary for JustMock to have a cake utility to work with. 
1 2