In Development
Last Updated: 17 Nov 2020 12:46 by ADMIN
Created by: Eric
Comments: 6
Type: Bug Report
0

when using JustMock Free in a net 5.0 app.  I am getting an Ninject exception that IAssemblyNameRetriever could not be found.  Looking at the code on github,

the NETCORE compile constant removes the line

AddComponent<IAssemblyNameRetriever, AssemblyNameRetriever>();

from StandardKernel.cs

however, CompiledModuleLoaderPlugin uses IAssemblyNameRetriever in it's constructor and

AddComponent<IModuleLoaderPlugin, CompiledModuleLoaderPlugin>();

is still included in the NETCORE version.

 

 

Pending Review
Last Updated: 04 Nov 2020 11:29 by Ivo

Update reference functionality wrongly suggests updating JustMock assembly reference and even more - detects currently referenced one as a lite version, see the screenshot below:

Pending Review
Last Updated: 04 Nov 2020 11:18 by Ivo
Currently, JustMock extension always uses the profiler deployed by the installation, which may be different from the one deployed by the JustMock.Commercial package. This could lead to unexpected failures in the rest run and different results inside and outside Visual Studio.
Declined
Last Updated: 26 Oct 2020 15:25 by ADMIN

Integration with Visual Studio Enterprise Code Coverage does not work if the project refers Microsoft.NET.Test.Sdk package version 16.3 (and above). The test run fails with exception:

Telerik.JustMock.Core.ElevatedMockingException : Cannot mock '<type to mock goes here>'. The profiler must be enabled to mock, arrange or execute the specified target.
    Detected active third-party profilers:
    * C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Team Tools\Dynamic Code Coverage Tools\amd64\covrun64.dll (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.

 

Completed
Last Updated: 21 Oct 2020 09:33 by ADMIN
Created by: Ivo
Comments: 1
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);
        }
    }
}

Completed
Last Updated: 21 Oct 2020 09:33 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. 
Completed
Last Updated: 21 Oct 2020 09:32 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)
In Development
Last Updated: 20 Oct 2020 10:17 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: 08 Oct 2020 10:07 by ADMIN
Created by: Mihail
Comments: 2
Type: Bug Report
2

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.

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.
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.
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: 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: 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: 24 Jun 2020 09:22 by ADMIN
The exception description does not clearly state that there is an issue with the member which is a target of the mocking which could easily lead to confusion. Attached sample project reproducing the issue.
Completed
Last Updated: 22 Jun 2020 11:12 by ADMIN
Debug Window affects performance in local test run when not debugging. The expected behavior is the Debug Window to not be loaded in this scenario.
Completed
Last Updated: 20 May 2020 10:55 by ADMIN
Completed
Last Updated: 24 Mar 2020 16:37 by ADMIN

Hi

When enabling JUSTMOCK Profiler it stops a MS rdlc report to render.

I have attached a simple sample demonstrating the error.

The error that the render gives back is the following.

The definition of this report is not valid or supported by this version of Reporting Services. The report definition may have been created with a later version of Reporting Services, or contain content that is not well-formed or not valid based on Reporting Services schemas. Details: Deserialization failed: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) Line 2, position 2.

I have tried to different target version of the .NET framework 4.5.2; 4.6.2, different platform targets "ANY,x86,x64", different VS IDE "2012, 2015", different Microsoft.ReportViewer.WinForm  ver. 11,12,14

Completed
Last Updated: 24 Mar 2020 16:25 by ADMIN
Having a sample configuration:
<DataCollector friendlyName="Code Coverage Wrapper">
  <Configuration>
    <SinkDataCollector friendlyName="Code Coverage" IsLinked="true" />
  </Configuration>
</DataCollector>
Currently, the attribute names are not consistent in the naming convention which might lead to errors.
1 2 3 4