I am trying to write a test and need to create a Message
object with the IsFault
property set to true. However, this property only has a getter. Does anyone know the best way to create a message where this property would be set to true?
Thanks
Use the Message.CreateMessage()
overload that accepts a MessageFault
object. Something like the following should work.
Message CreateMessage()
{
return Message.CreateMessage(
MessageVersion.Default,
MessageFault.CreateFault(new FaultCode("fault-string"), "reason"),
"action-string");
}