Example #1
0
        public async Task Workflow_WithResult1()
        {
            await SyncContext.Clear;

            // Verify that we can call a simple workflow that accepts a
            // parameter and returns a result.

            var stub = client.NewWorkflowStub <IWorkflowWithResult>();

            Assert.Equal("Hello Jeff!", await stub.HelloAsync("Jeff"));
        }
Example #2
0
        public async Task SyncSignal_StringResultError()
        {
            // Verify that async signals must return a Task.  [ISyncSignalNotTask]
            // defines its signal as returning a string.  Registration should fail.

            var worker = await client.NewWorkerAsync();

            await Assert.ThrowsAsync <WorkflowTypeException>(async() => await worker.RegisterWorkflowAsync <SyncSignalString>());

            // Verify that we're not allowd to create a workflow stub either.

            Assert.Throws <WorkflowTypeException>(() => client.NewWorkflowStub <SyncSignalString>());
        }
Example #3
0
        public async Task HelloWorld()
        {
            var stub   = client.NewWorkflowStub <IHelloWorkflow>();
            var result = await stub.HelloAsync("Jeff");

            Assert.Equal("Hello Jeff!", result);
        }
Example #4
0
        public async Task Nop()
        {
            await SyncContext.Clear;

            WorkflowReplay.Reset();

            var stub = client.NewWorkflowStub <IWorkflowReplay>();

            Assert.True(await stub.RunAsync(ReplayTest.Nop));
        }
Example #5
0
        public async Task SyncSignal_WithoutResult(int iteration)
        {
            LogStart(iteration);

            // Verify that sending a synchronous signal returning void
            // works as expected when there's no delay executing the signal.

            SyncSignal.Clear();

            var stub = client.NewWorkflowStub <ISyncSignal>();
            var task = stub.RunAsync(SyncSignal.WorkflowDelay);

            await stub.SignalAsync(TimeSpan.Zero);

            Assert.True(SyncSignal.SignalBeforeDelay);
            Assert.True(SyncSignal.SignalAfterDelay);

            await task;
        }