public void Run_Type_InvokesInner()
 => RunTest(
     typeof(TestActivity),
     wrapper =>
 {
     wrapper.Initialize(CreateServiceProvider());
     return(wrapper.Run(s_taskContext, s_input));
 },
     (wrapper, result) =>
 {
     result.Should().Be(s_input);
     InvokedContext.Should().Be(s_taskContext);
     InvokedInput.Should().Be(s_input);
 });
 public Task RunAsync_InvokesInner(Type type)
 => RunTestAsync(
     type,
     wrapper =>
 {
     wrapper.Initialize(CreateServiceProvider());
     return(wrapper.RunAsync(s_taskContext, $"[ \"{s_input}\" ]"));
 },
     (wrapper, result) =>
 {
     result.Should().Be($"\"{s_input}\"");
     InvokedContext.Should().Be(s_taskContext);
     InvokedInput.Should().Be(s_input);
 });
예제 #3
0
 public Task Execute_InvokesInner(Type type)
 => RunTestAsync(
     type,
     wrapper =>
 {
     wrapper.Initialize(CreateServiceProvider());
     return(wrapper.Execute(s_orchestrationContext, $"\"{Input}\""));
 },
     (wrapper, result) =>
 {
     result.Should().BeOneOf(Input, $"\"{Input}\"");
     InvokedContext.Should().BeOfType <WrapperOrchestrationContext>();
     InvokedInput.Should().BeOneOf(Input, $"\"{Input}\"");
 });
예제 #4
0
 public Task RunAsync_InvokesInner(Type type)
 => RunTestAsync(
     type,
     wrapper =>
 {
     CreateScope();
     wrapper.InnerActivity = (TaskActivity)Activator.CreateInstance(wrapper.InnerActivityType, this);
     return(wrapper.RunAsync(s_taskContext, $"[ \"{s_input}\" ]"));
 },
     (wrapper, result) =>
 {
     result.Should().Be($"\"{s_input}\"");
     InvokedContext.Should().Be(s_taskContext);
     InvokedInput.Should().Be(s_input);
 });
예제 #5
0
 public void Run_InvokesInner()
 => RunTest(
     typeof(TestActivity),
     wrapper =>
 {
     CreateScope();
     wrapper.InnerActivity = (TaskActivity)Activator.CreateInstance(wrapper.InnerActivityType, this);
     return(wrapper.Run(s_taskContext, s_input));
 },
     (wrapper, result) =>
 {
     result.Should().Be(s_input);
     InvokedContext.Should().Be(s_taskContext);
     InvokedInput.Should().Be(s_input);
 });
예제 #6
0
 public void RaiseEvent_InvokesInner(Type type)
 => RunTest(
     type,
     wrapper =>
 {
     wrapper.Initialize(CreateServiceProvider());
     wrapper.RaiseEvent(s_orchestrationContext, Event, $"\"{Input}\"");
     return(true);
 },
     (wrapper, _) =>
 {
     EventRaised.Should().Be(Event);
     InvokedContext.Should().BeOfType <WrapperOrchestrationContext>();
     InvokedInput.Should().BeOneOf(Input, $"\"{Input}\"");
 });
 public Task Execute_InvokesInner(Type type)
 => RunTestAsync(
     type,
     wrapper =>
 {
     CreateScope();
     wrapper.InnerOrchestration =
         (TaskOrchestration)Activator.CreateInstance(wrapper.InnerOrchestrationType, this);
     return(wrapper.Execute(s_orchestrationContext, $"\"{Input}\""));
 },
     (wrapper, result) =>
 {
     result.Should().BeOneOf(Input, $"\"{Input}\"");
     InvokedContext.Should().Be(s_orchestrationContext);
     InvokedInput.Should().BeOneOf(Input, $"\"{Input}\"");
 });
 public void RaiseEvent_InvokesInner(Type type)
 => RunTest(
     type,
     wrapper =>
 {
     wrapper.InnerOrchestration =
         (TaskOrchestration)Activator.CreateInstance(wrapper.InnerOrchestrationType, this);
     wrapper.RaiseEvent(s_orchestrationContext, Event, $"\"{Input}\"");
     return(true);
 },
     (wrapper, _) =>
 {
     EventRaised.Should().Be(Event);
     InvokedContext.Should().Be(s_orchestrationContext);
     InvokedInput.Should().BeOneOf(Input, $"\"{Input}\"");
 });