0
votes

I'm testing an NServiceBus saga that sends a command. The command has an attribute that tracks the time an action was performed. The handler for the message assigns CurrentMessageContext.TimeSent to LastSentOn in the outgoing message.

When I try to test the outgoing message, LastSentOn always has the value DateTime.MinValue, so....

How do I set CurrentMessageContext.TimeSent for testing in NServiceBus?

1
Quick guess, I think that is set in the message headers. Have you tried modifying it there?Adam Fyles

1 Answers

1
votes

Josh - this is not a direct answer to your question, but have you seen this?

http://github.com/NServiceBus/NServiceBus/issues/808

Looks like CurrentMessageContext.TimeSent has been deprecated and is now just a setting in the message headers. Perhaps you can use the header value instead.