public void SocketSendTest() { var config = JsonConvert.DeserializeObject <WorkflowConfiguration>(File.ReadAllText(@"./TestCases/test.json"), new WorkflowActionConfigConverter()); var definition = new WorkflowController().IntializeWorkflow(null)(config); definition.ExecuteCustomEvent((actionRegistry) => actionRegistry["Action 13"])(); }
public void WorkflowMutationTest() { var config = JsonConvert.DeserializeObject <WorkflowConfiguration>(File.ReadAllText(@"./TestCases/test.json"), new WorkflowActionConfigConverter()); var definition = new WorkflowController().IntializeWorkflow(null)(config); Assert.AreEqual("State 2", definition.ExecuteCustomEvent((actionRegistry) => actionRegistry["Action 3"])() .CurrentActionManager() .StateManager() .CurrentWorkflowState .WorkflowStateConfiguration .StateName); Assert.AreEqual("2", definition .ExecuteCustomEvent((actionRegistry) => actionRegistry["Action 4"])() .CurrentActionManager() .StateManager() .CurrentWorkflowState .CurrentParameterValues["Name1"] .Value); }
public void WorkflowConditionalExecutionTest() { //ToDo: Conditional execution is not correct, it should be able to derive the conditional parameter from anywhere var config = JsonConvert.DeserializeObject <WorkflowConfiguration>(File.ReadAllText(@"./TestCases/test.json"), new WorkflowActionConfigConverter()); var definition = new WorkflowController().IntializeWorkflow(null)(config); Assert.AreEqual("State 4", definition .ExecuteCustomEvent((actionRegistry) => actionRegistry["Action 9"])() .CurrentActionManager() .StateManager() .CurrentWorkflowState .WorkflowStateConfiguration .StateName); }
public void WorkflowQueueExecutionTest() { var config = JsonConvert.DeserializeObject <WorkflowConfiguration>(File.ReadAllText(@"./TestCases/test.json"), new WorkflowActionConfigConverter()); var definition = new WorkflowController().IntializeWorkflow(null)(config); definition.ExecuteCustomEvent((actionRegistry) => actionRegistry["Action 11"])(); var options = new KafkaOptions(new Uri("http://192.168.99.100:9092")); var router = new BrokerRouter(options); var consumer = new Consumer(new ConsumerOptions("workflowtest", router)); var amessage = consumer.Consume().FirstOrDefault(); Assert.IsNotNull(amessage); Assert.AreEqual("Action 6", amessage.Value.ToUtf8String()); }