1

I am using 3rd party library, and there is specificly a method that I want to shim.

public virtual QueueRuntimeInfo GetQueueRuntimeInfoAsync(string queuePath);

This method return QueueRuntimeInfo object. Here is the implementation of that class, which there is no constructor:

public class QueueRuntimeInfo
{
    internal QueueRuntimeInfo(string path)
    {
        this.Path = path;
    }
    public string Path { get; internal set; }
    public long MessageCount { get; internal set; }
}

Now, I want to shim GetQueueRuntimeInfoAsync method, which return QueueRuntimeInfo object, and then I want to set its property manually in my code.

Here is my shim method:

ShimManagementClient.AllInstances.GetQueueRuntimeInfoAsyncString = (managementClient, queuePath) =>
        {
            QueueRuntimeInfo queueRuntimeInfo; // what to do?!
            return queueRuntimeInfo;
        };

I think I can shim get methods of QueueRuntimeInfo class (PathGet and MessageCountGet). But still need to create the object somehow.

Patrick McDonald
  • 64,141
  • 14
  • 108
  • 120
Aryan Firouzian
  • 1,940
  • 5
  • 27
  • 41

0 Answers0