Open Jamie-Clayton opened 2 days ago
What is the ScenarioContext
? Instead of using _scenario.Set<>
and _scenario.Get<>
, does the code work if you use the following:
var policy = new TestableSaga<ParticipantRolesPolicy, ParticipantRolesData>(() => new ParticipantRolesPolicy(_logger.Object));
var link = new Link(new Uri("https://localhost:5001/api/nmi/TestNmi"),"self","GET");
var startMessage = new MeterServiceRequested("TestNmi", DateOnly.FromDateTime(DateTime.Now.AddDays(28)), Guid.NewGuid(), [link]);
var result = await policy.Handle(startMessage); 👈 This causes the error: Could not load type 'NServiceBus.IPipelineContextExtensions'
result.Completed.Should().BeFalse();
result.FindSentMessage<ConfirmParticipantRoles>().Nmi.Should().Be(startMessage.Nmi);
Exactly the same error. Debugging and stepping through the logic results in the same logic execution.
// Removing this SpecFlow specific code makes no difference to the step through execution of the codebase.
_scenario.Set(bla)
_scenario.Get<bla>
var policy = new TestableSaga<ParticipantRolesPolicy, ParticipantRolesData>(() => new ParticipantRolesPolicy(_logger.Object));
var link = new Link(new Uri("https://localhost:5001/api/nmi/TestNmi"),"self","GET");
var startMessage = new MeterServiceRequested("TestNmi", DateOnly.FromDateTime(DateTime.Now.AddDays(28)), Guid.NewGuid(), [link]);
var result = await policy.Handle(startMessage); 👈 This ALSO causes the error: Could not load type 'NServiceBus.IPipelineContextExtensions'
Here is a screenshot of the /bin directory that is executing the code. There is no NServicebus DLL in the directory. So I'm thinking its part of the issue.
Here are the implicit Project references.
Describe the bug
Description
Trying to automate the testing of Sagas with Specflow BDD and XUnit. This failed quickly.
Expected behavior
I should be able to test my Sagas before using them.
Actual behavior
Exception trying to test a simple SAGA configuration.
Versions
in .net 8 Nservicebus v9.22
Please list the version of the relevant packages or applications in which the bug exists.
Steps to reproduce
BDD statement Given a Network Meter Identifier (NMI) exists When we run the Participant Roles Policy Then a log will be created
Saga code for reference (nothing complicated)
Relevant log output
Additional Information
I've tried removing the constructor that injected ILogger<>, but it didn't change the behaviour.