Completed
Last Updated: 21 Aug 2024 14:04 by ADMIN
Ivo
Created on: 17 Oct 2022 12:22
Type: Bug Report
4
Using declaration causes InvalidProgramException

if you use the C# using declaration and have JustMock advanced (elevated) mode enabled, the runtime will throw an InvalidProgramException.

Find below the sample code that demonstrates the issue:

public class TestClass : IDisposable
{
    public void Dispose()
    {
    }
}

[TestClass]
public class Fixture
{
    public interface ITest { }

    [TestMethod]
    public async Task Test()
    {
        ITest mock = Mock.Create<ITest>();
        using TestClass test = new();
    }
}

7 comments
ADMIN
Ivo
Posted on: 21 Aug 2024 14:04

Hello Jeremy,

Small update to the latest use case with DataRawAtrribute - the problem described cannot be reproduced with the 2024 Q2 release. I would like to ask you to open a new support ticket so that we can continue our communication on the issue and keep this thread sorted.

Regards,
Ivo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

ADMIN
Ivo
Posted on: 24 Jul 2024 13:20

Hello Jeremy,

Thanks for reporting this finding. We will investigate the issue timely and keep you posted about any further activities related to it.

Regards,
Ivo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Jérémy
Posted on: 23 Jul 2024 07:31

Hello, 

I encounter the same problem with the version Q2 2024 when i'm using [DataRow] Attribute on an async TestMethod and i want to test the value of the parameter.

For exemple :

        [TestMethod]
        [DataRow(false)]
        [DataRow(true)]
        public async Task SampleTest(bool param1)
        {

            if (param1)
            {

            }

        }

 

Turn OFF the "Automatic Mock Repository Cleanup Enabled" flag resolve the problem.

Add a call to an async method at the end of the function resolve also the problem.
For exemple, this version of the test Method works : 

 

Thank you

                
ADMIN
Ivo
Posted on: 15 May 2024 15:32

The issue is fixed in Q2 2024 (2024.2.514.325)

 

Regards,
Ivo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

David
Posted on: 26 Feb 2024 23:58
Yes no worries on the patience :)  Need that when programming ehh?  Really good that it is a top priority too.  Thanks for your update on the planned fixes.
ADMIN
Ivo
Posted on: 22 Feb 2024 08:27

Hello David,

It is one of our top priorities for the next release (scheduled for mid-May, but we will do our best to deliver it earlier), so I would like to ask you for a bit of patience.

Regards,
Ivo
Progress Telerik

A brand new JustMock course was just added to the Virtual Classroom - the free self-paced technical training portal that gets you up to speed with Telerik and Kendo UI products! Check it out at https://learn.telerik.com.
David
Posted on: 22 Feb 2024 00:06

Can we please get this fixed?  Our whole team has to turn OFF the "Automatic Mock Repository Cleanup Enabled" flag EVERY time we restart Visual Studio 2022.  If we don't we run into this error. 

ALSO the "Automatic Mock Repository Cleanup Enabled" flag doesn't stay set to false - keeps reverting back to TRUE.