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


Approved
Last Updated: 05 Jun 2019 11:21 by ADMIN
The JustMock profiler should be added to the commercial NuGet package distributed from the Telerik private NuGet server.
Approved
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;
    }
}

[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.

Completed
Last Updated: 20 May 2019 09:44 by ADMIN
2019.R1 JustMock Test project templates need to be updated to support .Net Core, currently they are targeting just .Net Framework (see attached screen shot).
In Development
Last Updated: 03 Apr 2019 07:43 by ADMIN
Docker is a container acting like an isolated environment. Research how the JustMock profiler can be registered into such container.
Hosted VSTS should work on the same principle. Research how the registry could be accessed through VSTS extension or other tools.
Approved
Last Updated: 01 Apr 2019 14:13 by ADMIN
Created by: Lyubomir
Comments: 0
Type: Feature Request
0
Currently JustMock does not support mocking non-public generic methods. There are couple of possible workarounds but the need for proper implementation for mocking the language feature is still required.
Approved
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.
Approved
Last Updated: 25 Feb 2019 16:35 by ADMIN
Created by: Mihail
Comments: 0
Type: Feature Request
0
Implement support for future mocking of non-public classes.
Approved
Last Updated: 25 Feb 2019 14:50 by ADMIN
Implement support for future mocking of public class with non-public arguments.
Such example is the future mocking of the class Timer with a private callback.
Completed
Last Updated: 16 Jan 2019 11:55 by ADMIN
The main point behind this request is to add new command line option to JustMockRunner in order to enable profiler without need for being registered, more details about this feature can be found on MSDN at https://msdn.microsoft.com/en-us/library/ee471451(v=vs.100).aspx
Completed
Last Updated: 16 Jan 2019 08:39 by ADMIN
Created by: Robert
Comments: 7
Type: Feature Request
13

			
Declined
Last Updated: 12 Oct 2018 10:25 by ADMIN
Created by: Nick
Comments: 1
Type: Feature Request
0
If I define a fluent API, I might have an interface such as this:

public interface IRegistrar { 

IRegistrar UsingThis(object someThing);

IRegistrar UsingThat<TThatThing>() }

If I create a mock of this using the default Behaviour.RecursiveLoose and make no arrangements, calls to the methods will return new mocks of the type, rather than the same instance that was called. 

It would be nice to have a behaviour type that can return the same instance (in this case the mocked instance) without having to define a stub for each method call.

My code under test might look like:

IRegistrar reg;

reg

  .UsingThis(new object())

  .UsingThat<int>();

Currently, a test on the second call will fail if written against the mock assigned to 'reg'.
Approved
Last Updated: 12 Oct 2018 08:32 by Troy
Created by: Troy
Comments: 0
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.
Approved
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.
Completed
Last Updated: 12 Sep 2018 14:04 by ADMIN
ADMIN
Created by: Kamen Ivanov
Comments: 1
Type: Feature Request
3
It would be good if we could use named parameters inside Mock.Arrange method.
Completed
Last Updated: 23 Jul 2018 13:47 by Nacho
Created by: Stefan
Comments: 3
Type: Feature Request
3
I want to be able to arrange the return value of `new` expressions, like Mock.Arrange(() => new FileInfo()).Returns(mockFileInfo).
Then, I expect that `new FileInfo()` will always return my mock instance.
Approved
Last Updated: 23 Jul 2018 13:39 by Stefan
Approved
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.
Approved
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.
1 2 3