1
0
mirror of synced 2024-12-22 17:23:07 +01:00

Testscript van David om flow ends te testen

This commit is contained in:
Menno van Lavieren 2017-07-25 15:50:38 +02:00
parent e3496b0aaf
commit f491a31847
3 changed files with 42 additions and 0 deletions

37
Test/FlowEndController.cs Normal file
View 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
{
}
}
}

View File

@ -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();
}
}
}

View File

@ -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" />