Pending Review
Last Updated: 21 Sep 2020 10:01 by Ivo
The issue is reproducible inside Visual Studio 2017, the same tests are running normaly outside the IDE or using 2019.
Unplanned
Last Updated: 18 Sep 2020 14:24 by ADMIN
Created by: Ivo
Comments: 0
Type: Feature Request
0

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

 

 

 
Unplanned
Last Updated: 18 Sep 2020 08:44 by ADMIN
Currently, JustMock DebugWindow service is using a hardcoded port range which might conflict with other existing TCP services.
Unplanned
Last Updated: 18 Sep 2020 08:00 by ADMIN
Created by: Dan Avni
Comments: 1
Type: Feature Request
0
After creating a future mock for some method in an object in which I also specify the mock must be called, there is no way to assert that the mock was actually called. Using Mock.Assert on the test method always passes even when the mocked method was not called.
In Development
Last Updated: 17 Sep 2020 09:50 by ADMIN
Created by: Mihail
Comments: 1
Type: Feature Request
0
JustMock should support .NET 5
Completed
Last Updated: 17 Sep 2020 09:39 by Yosi
The JustMock profiler should be added to the commercial NuGet package distributed from the Telerik private NuGet server.
Completed
Last Updated: 17 Sep 2020 09:25 by ADMIN
Created by: Robert
Comments: 1
Type: Bug Report
1
The test execution of a test hangs forever. Please see the attached VS 2019 Solution that contains one TestMethod.

R2 2020 is unusable. I reverted back to R1 and there the tests succeed in less than a second.
Completed
Last Updated: 17 Sep 2020 09:24 by ADMIN

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.

Completed
Last Updated: 17 Sep 2020 09:18 by ADMIN
Currently, the Debug Window could be used only with one instance of Visual Studio. The goal of this feature is the Debug Window to support multiple independent instances of Visual Studio.
Completed
Last Updated: 17 Sep 2020 09:15 by ADMIN

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.

Unplanned
Last Updated: 16 Sep 2020 08:24 by ADMIN
The required configuration for code coverage transparent integration has been changed since 2020.2 release and currently JustMock integration with dotCover is not working as expected. Manually applying the extra entries fixes the issue with execution, but there is no actual coverage collection. 
Unplanned
Last Updated: 10 Sep 2020 15:10 by ADMIN

Attempt to use JustMock VSTest v.2 task to run the elevated mode tests with coverage when the "Test platform version" option is set to value "Installed by Tools Installer" fails with error:

Telerik.JustMock.Core.ElevatedMockingException: Cannot mock '<target type goes here>'. The profiler must be enabled to mock, arrange or execute the specified target.
Detected active third-party profilers:
* {9317ae81-bcd8-47b7-aaa1-a28062e41c71} (from process environment)
Disable the profilers or link them from the JustMock configuration utility. Restart the test runner and, if necessary, Visual Studio after linking.

Unplanned
Last Updated: 10 Sep 2020 07:19 by Benjamin

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: 20 Aug 2020 12:55 by ADMIN
Created by: Ivo
Comments: 0
Type: Bug Report
4

The internal (non-public) events are not handled properly by JustMock, there is no indication for error, Raise arrangement simply does not working as expected. The following sample reproduces the issue:

namespace TestExample
{
    public class ClassWithEvents
    {
        internal event EventHandler<EventArgs> InternalEventToTest;
    }

    [TestClass()]
    public class EventTests
    {
        [TestMethod]
        public void ClassWithEvents_InternalEventTest()
        {
            //Arrange
            bool eventRaised = false;
            ClassWithEvents classWithEvents = Mock.Create<ClassWithEvents>();
            classWithEvents.InternalEventToTest += (object sender, EventArgs e) =>
            {
                eventRaised = true;
            };

            // Act
            Mock.Raise(() => classWithEvents.InternalEventToTest += null, new EventArgs());

            // Assert
            Assert.IsTrue(eventRaised);
        }
    }
}

Unplanned
Last Updated: 13 Aug 2020 14:29 by ADMIN
When the ports with which the DebugWindow should operate are changed in the DebugWindow host configuration the process is started with the default values instead of the new values.
Unplanned
Last Updated: 06 Aug 2020 14:20 by ADMIN

The test run is aborted when a .testsettings is used for executing JustMock tests. The .testsettings contains only a description.

<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Local" id="15694c75-be1c-4113-9d42-2cbe1013c41c" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
  <Description>These are default test settings for a local test run.</Description>
</TestSettings>

It seems that the usage of the MSTest element is breaking the execution. As .testsettings are deprecated use .runsettings instead without MSTest element.

Unplanned
Last Updated: 04 Aug 2020 11:28 by ADMIN

I am unable to debug my unit test .NET project. I keep getting several of these errors, and it is super slow as code tries to execute every line. I have rebooted and restarted VS 2019 several times, reinstalled JustMock but the error won't go away.

Visual Studio Output windows shows following repeated errors:

Exception thrown calling IDebugWindowPlugin plugin: System.NullReferenceException: Object reference not set to an instance of an object.

   at Telerik.JustMock.Plugins.ObjectInfo.FromObject(Object value)
   at Telerik.JustMock.Core.MocksRepository.<>c.<DispatchInvocation>b__51_2(Object arg)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Telerik.JustMock.Core.MocksRepository.DispatchInvocation(Invocation invocation)
Unplanned
Last Updated: 30 Jul 2020 09:21 by ADMIN

I have a class, which has a private async method, which has a local function, like the following example

 

internal class TestClass

{

 ......

        private async Task<bool> TestPrivateMethod()
        {
            var x = await TestLocalFunction();
            return x;

            async Task<bool> TestLocalFunction()
            {
                await Task.Delay(5);
                return true;
            }
 }

 

When I try to mock the local function, thows an error "System.MissingMemberException : C# 7 local function 'TestLocalFunction' with the given signature was not found inside method 'TestPrivateMethod'"

 

var testClassInstance = Mock.Create<TestClass>(Behavior.CallOriginal);

Mock.Local.Function.Arrange<Task<bool>>(testClassInstance, "TestPrivateMethod", "TestLocalFunction").Returns(Task.FromResult(true));

 

Unplanned
Last Updated: 20 Jul 2020 09:41 by ADMIN

Having the following COM interop class

[ClassInterface(ClassInterfaceType.None)]
[Guid("86332C4E-0BDE-46EC-94C5-0A946C33C682")]
[TypeLibType(TypeLibTypeFlags.FCanCreate)]
public class MyComObjectClass : IMyComObject, MyComObject
{
    public MyComObjectClass();

    [DispId(1)]
    public virtual string Echo(string message);
}

and the sample class that uses it:

public class MyComObjectClassProxy
{
    public string Echo(string message)
    {
        IMyComObject itf = null;
        try
        {
            itf = new MyComObjectClass();
            return itf.Echo(message);
        }
        finally
        {
            if (itf != null)
            {
                Marshal.ReleaseComObject(itf);
            }
        }
    }
}

When I try to call the arranged constructor I am getting an error "Cannot create instances of type requiring managed activation", the unit test code:

[TestMethod]
public void TestMethod1()
{
    var mock = Mock.Create<MyComObjectClass>();
    Mock.Arrange(() => new MyComObjectClass()).Returns(mock);

    var sut = new MyComObjectClassProxy();
    var actual = sut.Echo("Message");

    Assert.AreEqual(string.Empty, actual);
}
Unplanned
Last Updated: 15 Jul 2020 10:04 by ADMIN
Created by: Mihail
Comments: 0
Type: Bug Report
1

When a breakpoint is added inside an async test that uses JustMock the debugger is failing to hit it. 

To reproduce the issue follow the next steps:

1. Open the attached project

2. Create a breakpoint at the first arrangement in the async test method.

3. Start debugging the async test

Result: the breakpoint is not hit.

The issue is observed for both .NET Core and .NET Framework.

1 2 3 4 5 6