Testscript van David om flow ends te testen
This commit is contained in:
parent
e3496b0aaf
commit
f491a31847
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!");
|
Console.WriteLine("Done!");
|
||||||
|
|
||||||
|
connection.GetPublisher().Publish(new FlowEndController.PingMessage());
|
||||||
|
|
||||||
container.GetInstance<IFlowStarter>().Start<MarcoController>(c => c.StartFlow);
|
container.GetInstance<IFlowStarter>().Start<MarcoController>(c => c.StartFlow);
|
||||||
|
|
||||||
var emitter = container.GetInstance<MarcoEmitter>();
|
var emitter = container.GetInstance<MarcoEmitter>();
|
||||||
emitter.Run().Wait();
|
emitter.Run().Wait();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="FlowEndController.cs" />
|
||||||
<Compile Include="MarcoEmitter.cs" />
|
<Compile Include="MarcoEmitter.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user