I am writing a test method for below mention method -
Method in my concrete class -
public async Task ReadServiceBusMessage(ProcessMessageEventArgs args)
{
// Some code
}
-- In my test method-
public async Test_ReadServiceBusMessage()
{
private Mock<ProcessMessageEventArgs> _eventArgs;
**_eventArgs = new Mock<ProcessMessageEventArgs>(MockBehavior.Strict);**
await concreteClassObj.ReadServiceBusMessage(_eventArgs.Object);
}
this object creation (highighted in bold) is giving below exception message
Property ProcessMessageEventArgs.Message does not have a setter
You'll need to pass the message to the constructor. For example:
More context and further examples can be found in the Mocking Client Types sample.