Completed
Last Updated: 12 May 2023 09:34 by ADMIN
Mikhail
Created on: 12 Jan 2022 08:38
Type: Bug Report
1
Can not mock Interface contained Method with 'in' parameter

Mock.Create<IPool>() fails with 

Telerik.JustMock.Core.MockException : Abstract type 'IPool' is not accessible for inheritance.
   In Telerik.JustMock.Core.MocksRepository.Create(Type type, MockCreationSettings settings)
   In Telerik.JustMock.Mock.<>c__39`1.<Create>b__39_0()
   In Telerik.JustMock.Core.ProfilerInterceptor.GuardInternal[T](Func`1 guardedAction) 

when trying to create a mock object from

public interface IPool
{
    object GetItem(in Struct a, out Class b);
}

 

3 comments
ADMIN
Ivo
Posted on: 12 May 2023 09:34

Hello Jean-Paul,

Could you please open a new support thread so we can discuss the issue in details. Thanks!

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.
Jean-Paul
Posted on: 11 May 2023 00:13

I am experiencing this exact issue in R1 2023. Same Exception message. Works when `in` keyword is removed.

 

 

ADMIN
Ivo
Posted on: 07 Dec 2022 11:51

The issue is fixed with JustMock R3.2022 SP1 (2022.3.1109.1). Enjoy!

 

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.