Hi
Is there a way to use the NotifyProtocol.GetKeys extension method in a unit test?
I’m using Skyline.DataMiner.Dev.Protocol version 10.1.0.1.
Andries Deklerck [SLC] [DevOps Member] Selected answer as best 29th March 2023
Hi Andries,
To mock the behavior of the GetKeys method you will need to mock the “notifies” directly, due to being an extension method, you will need to mock the underlying calls.
In your case, you would need to mock NotifyProtocol 397 and NotifyProtocol 168.
Andries Deklerck [SLC] [DevOps Member] Selected answer as best 29th March 2023
Hi,
Mocking an extension method directly is not possible.
Since RN27995 this method has become part of the SLProtocol interface. If you’re using 10.2.0 (or 10.1.1) as Protocol Dev pack then you should be able to mock the GetKeys method directly.
Regards,
Laurens Moutton [SLC] [DevOps Enabler] Answered question 28th March 2023