Testscript van David om flow ends te testen
This commit is contained in:
parent
d820baecf7
commit
580a4716c0
37
Test/FlowEndController.cs
Normal file
37
Test/FlowEndController.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Tapeti.Annotations;
|
||||
using Tapeti.Flow;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
[MessageController]
|
||||
[DynamicQueue]
|
||||
public class FlowEndController
|
||||
{
|
||||
private readonly IFlowProvider flowProvider;
|
||||
|
||||
public FlowEndController(IFlowProvider flowProvider)
|
||||
{
|
||||
this.flowProvider = flowProvider;
|
||||
}
|
||||
|
||||
public IYieldPoint StartFlow(PingMessage message)
|
||||
{
|
||||
Console.WriteLine("PingMessage received, call flowProvider.End()");
|
||||
return Finish();
|
||||
}
|
||||
|
||||
|
||||
private IYieldPoint Finish()
|
||||
{
|
||||
return flowProvider.End();
|
||||
}
|
||||
|
||||
|
||||
public class PingMessage
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -53,10 +53,14 @@ namespace Test
|
||||
|
||||
Console.WriteLine("Done!");
|
||||
|
||||
connection.GetPublisher().Publish(new FlowEndController.PingMessage());
|
||||
|
||||
container.GetInstance<IFlowStarter>().Start<MarcoController>(c => c.StartFlow);
|
||||
|
||||
var emitter = container.GetInstance<MarcoEmitter>();
|
||||
emitter.Run().Wait();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,6 +52,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FlowEndController.cs" />
|
||||
<Compile Include="MarcoEmitter.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user