Planned
Last Updated: 19 Oct 2021 10:31 by ADMIN
Created by: Ivo
Comments: 2
Type: Feature Request
2

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

 

 

 
Under Review
Last Updated: 15 Oct 2021 13:45 by ADMIN
Created by: Jason
Comments: 2
Type: Bug Report
0

I've already created an issue in the JustMock repo, you can find it here: https://github.com/telerik/JustMockLite/issues/162. Below is the text from that issue...

I'm currently working on a PR to add JustMock to the suite of performance tests that currently exist in that repository. The problem is that some of the tests (like OneParameter and Callback) take a long time to finish for JustMock. I'm not sure why, but it's making it such that JustMock can't be added to the test suite. More to the point, the PR can't be accepted as-is because it would take too long to finish.

One thing Steve (owner of the repo) and I talked about is if the invocationCount value passed to the SimpleJobAttribute (which exists on both the MockingBenchmark and MockingBenchmark<T> classes) is reduced from 100,000 to something like 1,000, the tests then finish, but that doesn't address the underlying issue why these tests for JustMock slow down over repeated called.

There may be something in the benchmark tests with the way I've set things up with JustMock that may be incorrect. I've never used JustMock until today :). If there's something that I'm doing right, please let me know.

Unplanned
Last Updated: 07 Oct 2021 14:06 by ADMIN
Created by: Alan
Comments: 4
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: 23 Sep 2021 14:25 by ADMIN
A System.InvalidProgramException is thrown when async unit tests are executed inside Visual Studio with code coverage. The unit tests are testing an implementation of Microsoft.Extensions.Caching.Distributed.IDistributedCache.
Completed
Last Updated: 16 Sep 2021 08:43 by ADMIN
Created by: Mihail
Comments: 1
Type: Feature Request
9
Implement support for executing JustMock tests on Linux
Completed
Last Updated: 16 Sep 2021 08:42 by ADMIN
Created by: Mihail
Comments: 1
Type: Feature Request
0
JustMock should have support for the upcoming official release of Visual Studio 2022
Completed
Last Updated: 16 Sep 2021 08:40 by ADMIN
Created by: Calvin
Comments: 3
Type: Bug Report
0

I filed a prior ThreadLeak:

Thread leak in JustMock (telerik.com)

 

I think I've found another one: (VS version 16.10.31321.278)

telerik_justmock_debugwindow_service_client!Telerik.JustMock.DebugWindow.Service.Client.ServiceHostMonitor.MonitorTimer_Elapsed

Apparently, the MonitorTimer_Elapsed code is running on a threadpool thread and it takes longer than 1 sec (perhaps it's waiting on a lock?).

Another timer tick occurs and the method is called again. Eventually, the ThreadPool runs out of threads and grows by about 1 thread per second (1Mb /sec leak)

In one dump 2Gig was used (1962 threads on the same MonitorTimer_Elapsed stack frame)

In that same dump there were 52 stacks with this frame:

telerik_justmock_debugwindow_service_client!Telerik.JustMock.DebugWindow.Service.Client.ConnectionSetupServiceClientBase`[[System.__Canon,mscorlib]].get_ServiceAvailable

(this was the same item as my prior report).

 

Completed
Last Updated: 16 Sep 2021 08:38 by ADMIN

The following test fails:

[TestMethod]
public void TestCallOrderWithInOrder()
{
	// Arrange
	var mockClass1 = Mock.Create<Class1>();
	var mockClass2 = Mock.Create<Class2>();

	Mock.Arrange(() => mockClass1.Method1())
		.InOrder();
	Mock.Arrange(() => mockClass2.Method1())
		.InOrder()
		.Occurs(2);
	Mock.Arrange(() => mockClass1.Method2())
		.InOrder();

	// Act
	mockClass1.Method1();

	mockClass2.Method1();
	mockClass2.Method1(); // <--- this call is not allowed by
						  //      InOrder clause currently 
						  //      and throws AssertFailedException

	mockClass1.Method2();

	// Assert
	Mock.Assert(mockClass1);
	Mock.Assert(mockClass2);
}

Completed
Last Updated: 16 Sep 2021 08:37 by ADMIN

The following test is not working anymore since version JustMock_2021_2_615_4 but was working with JustMock_2021_1_326_1 and older versions:

public interface ITest
{
    void Test(string text);
}

[TestMethod]
public void MyTestMethod()
{
    var mock = Mock.Create<ITest>();
    Mock.Arrange(() => mock.Test("")).IgnoreArguments().OccursNever();
    Mock.Arrange(() => mock.Test(Arg.Matches<string>(a => a == "a"))).InOrder().OccursOnce();
    Mock.Arrange(() => mock.Test(Arg.Matches<string>(a => a == "b"))).InOrder().OccursOnce();


    mock.Test("a");
    mock.Test("b");

    Mock.Assert(mock);
}

If I remove the OccorsNever line, its working.
If I remove the 2 InOrder, its working.

Seems that something change there: https://www.telerik.com/support/whats-new/justmock/release-history/justmock-r2-sp1-2021

Planned
Last Updated: 10 Sep 2021 14:15 by ADMIN

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.

Unplanned
Last Updated: 19 Aug 2021 08:02 by ADMIN
Created by: Mihail
Comments: 0
Type: Feature Request
0

Allow the developer to create custom behaviors and use them in an arrangement. Something like the following:

            Mock.Arrange(() => foo.CalcData(Arg.AnyInt, Arg.AnyInt), new IBehavior[]
            {
                new LogInvocation(),
                new ReturnBaseOrDefaultValue(),
            });

Unplanned
Last Updated: 19 Aug 2021 07:54 by ADMIN

The new public API should allow the developer to access the invocations for a particular arrangement. Something like the following:

IEnumerable<IInvocaiton> invocations = foo.GetInvocationsFor((x) => x.CalcData(2, 2));

Unplanned
Last Updated: 19 Aug 2021 07:50 by ADMIN

Implement a new public API that will allow the developer to iterate over all invocations of mock arrangements. Something like the following:

IEnumerable<IInvocaiton> invocations = Mock.Invocations;

Completed
Last Updated: 17 Aug 2021 07:19 by ADMIN

Using elevated mocking mode (profiler enabled) with long path names for the test containers (above 260 characters) causes the following command:

dotnet test

to fail with error:

Testhost process exited with error: Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(System.String[])
. Please check the diagnostic logs for more information.

Test Run Aborted.

Unplanned
Last Updated: 13 Jul 2021 07:34 by ADMIN
Create a Mock.Assert(); or a similar method that will verify all mock objects arranged for the current test method complies with the set expectation.
Unplanned
Last Updated: 02 Jun 2021 11:42 by ADMIN

The documentation on Fluent Mocking ends with this statement:

Important

Note that when you use Fluent Asserts only arrangements marked with either MustBeCalled or Occurs will be verified. For other tests you have to use the explicit assert.

What this fails to note is that, while this is true of the function "Assert", there is another function, "AssertAll", which will flag an error if any Arranged function call was not utilized.

 

On a related note, I left other suggestions for this same page a day or two ago.  I would have liked to leave the above statement using the same feedback utility, but I can no longer find the control that I used to leave those initial suggestions.

Unplanned
Last Updated: 26 May 2021 10:10 by ADMIN
String parameter "message" inside Mock.Assert APIs could be easily interpreted in the wrong way by associating them with the concrete assertion instead of the scope where this particular statement is taking place.
Unplanned
Last Updated: 18 May 2021 10:21 by ADMIN
JustMock Profiler prevents XAML Hot Reload and Visual Tree debugging functionalities. Disabling the profiler fixes the issue. This happens only for .NET Core WPF, under .NET Framework, everything runs as expected.
Unplanned
Last Updated: 17 May 2021 08:38 by ADMIN
Created by: Mihail
Comments: 0
Type: Feature Request
1
Integration with dotCover is only available through Telerik.JustMock.Configuration.exe, which works with the machine's registry and needs JustMock to be installed. This approach is not applicable to cloud-based build agents and therefore we need an integration that does not require the installation of JustMock.
Completed
Last Updated: 17 May 2021 08:10 by ADMIN
Trial period expiration disables the essential functionality inside JustMock extension menu, but there is no clear sign for the reason. This item is about improving this situation, by making the trial expiration explicitly and easily visible to the user.
1 2 3 4 5 6