Closed vinydanylo closed 1 year ago
FakeBus
doesn't do any serialization, it's actually the SagaFixture
thing that runs a full bus behind the scenes.
And I believe this is an oversight on my part, as e.g. I would want SagaFixture
to be able to provide a realistic experience also when using e.g. Protobuf to serialize message, and so it should be configurable.
Let me just take a look. Maybe I will release an update in a few hours π
OK it turned out that it was actually possible π
Check out this test case that I've just added.
In the test I created a local method GetConfigurer
that returns a RebusConfigurer
that has Newtonsoft JSON.NET configured. This way it seems like loops can be serialized just fine. π
Let me know if it doesn't work like you expected.
Yep, I just got the test run and your solution worked like a charm! Thanks a lot for your help and for making Rebus great!
So some of my DTOs have looping references and it's not a problem as I configured Rebus to use NewtonSoft.Json. I have upgraded to Rebus 7.0 and, therefore to Rebus.TextHelpers 8.0. I've read that Rebus now uses
System.Text.Json
as default Json serializer, therefore FakeBus as well. The problem I have now is that System.Text.Json can't handle my DTOs. I looked on the Wiki but I could not find a way to set the JsonSerializer of FakeBus.I just want to restate that the application is running fine with the new Rebus, my only problem is with Unit Tests.
Do you have any suggestion?
Here I've pasted some code snippets.