1
0
mirror of synced 2024-11-16 06:43:51 +00: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 d820baecf7
commit 580a4716c0
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!"); 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();
} }
} }
} }

View File

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