From f491a31847f3df599a5e94d6c9a2e5766115907f Mon Sep 17 00:00:00 2001 From: Menno van Lavieren Date: Tue, 25 Jul 2017 15:50:38 +0200 Subject: [PATCH] Testscript van David om flow ends te testen --- Test/FlowEndController.cs | 37 +++++++++++++++++++++++++++++++++++++ Test/Program.cs | 4 ++++ Test/Test.csproj | 1 + 3 files changed, 42 insertions(+) create mode 100644 Test/FlowEndController.cs diff --git a/Test/FlowEndController.cs b/Test/FlowEndController.cs new file mode 100644 index 0000000..522b98f --- /dev/null +++ b/Test/FlowEndController.cs @@ -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 + { + + } + + } +} diff --git a/Test/Program.cs b/Test/Program.cs index 8f29209..78f9770 100644 --- a/Test/Program.cs +++ b/Test/Program.cs @@ -53,10 +53,14 @@ namespace Test Console.WriteLine("Done!"); + connection.GetPublisher().Publish(new FlowEndController.PingMessage()); + container.GetInstance().Start(c => c.StartFlow); var emitter = container.GetInstance(); emitter.Run().Wait(); + + } } } diff --git a/Test/Test.csproj b/Test/Test.csproj index 5f67230..ef1c3c7 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -52,6 +52,7 @@ +