Beispiel #1
0
 public override Dictionary <string, string>?Complete(WorkloadContext context)
 {
     return(new()
     {
         { "ok", "foo" },
         { "nong", "bar" },
     });
 public ExtractOperationContextFromMessageMetadataStep(
     WorkloadContext workloadContext,
     ILogger <ExtractOperationContextFromMessageMetadataStep> logger)
 {
     _workloadContext = workloadContext;
     _logger          = logger;
 }
Beispiel #3
0
        public override async Task TeardownAsync(WorkloadContext context)
        {
            await client.DisposeAsync();

            await channel.ShutdownAsync();

            channel.Dispose();
        }
        public ExtractOperationContextFromMessageMetadataStepFixture()
        {
            FakeOperationContext = OperationContext.New();
            WorkloadContext      = new WorkloadContext();
            IntegrationMessage   = new FakeIntegrationMessage();

            Logger = Mock.Of <ILogger <ExtractOperationContextFromMessageMetadataStep> >();
            Step   = new ExtractOperationContextFromMessageMetadataStep(WorkloadContext, Logger);
        }
Beispiel #5
0
        public override async Task TeardownAsync(WorkloadContext context)
        {
            if (channel != null)
            {
                await channel.ShutdownAsync();

                channel.Dispose();
            }
        }
Beispiel #6
0
 public override Task SetupAsync(WorkloadContext context)
 {
     channel = GrpcChannel.ForAddress("http://localhost:5059");
     client  = MagicOnionClient.Create <IEchoService>(channel);
     return(base.SetupAsync(context));
 }
Beispiel #7
0
 public override async Task SetupAsync(WorkloadContext context)
 {
     channel = GrpcChannel.ForAddress("http://localhost:5059");
     client  = await StreamingHubClient.ConnectAsync <IEchoHub, IEchoHubReceiver>(channel, this);
 }
Beispiel #8
0
 public override Task TeardownAsync(WorkloadContext context)
 {
     logger.LogInformation("Called Teardown");
     return(Task.CompletedTask);
 }
 public ExtractOperationContextFromMessageMetadataStepFixture SetupWorkloadContextToBeEmpty()
 {
     WorkloadContext.Clear();
     return(this);
 }
Beispiel #10
0
 public override async Task TeardownAsync(WorkloadContext context)
 {
 }
Beispiel #11
0
 public override async Task ExecuteAsync(WorkloadContext context)
 {
     logger.LogInformation("Execute:" + (++execCount));
     await Task.Delay(TimeSpan.FromSeconds(1));
 }
Beispiel #12
0
 public HomeController(WorkloadContext context)
 {
     db = context;
 }
Beispiel #13
0
 public override async Task ExecuteAsync(WorkloadContext context)
 {
     await client.SayHelloAsync(new HelloRequest());
 }
Beispiel #14
0
 public override async Task ExecuteAsync(WorkloadContext context)
 {
     await client !.SayHelloAsync(new HelloRequest(), cancellationToken: context.CancellationToken);
 }
Beispiel #15
0
 public override async Task ExecuteAsync(WorkloadContext context)
 {
     await client.EchoAsync(null !);
 }
Beispiel #16
0
 public override async Task SetupAsync(WorkloadContext context)
 {
     channel = GrpcChannel.ForAddress("http://localhost:5027");
     client  = new Greeter.GreeterClient(channel);
 }
Beispiel #17
0
 protected bool Equals(WorkloadContext other)
 => _items.Equals(other._items);
 public WorkloadContextFixture()
 {
     WorkloadContext = new WorkloadContext();
 }
Beispiel #19
0
 public override Task TeardownAsync(WorkloadContext context)
 {
     Debug.Log("Teardown");
     return(Task.CompletedTask);
 }
Beispiel #20
0
 public override Task ExecuteAsync(WorkloadContext context)
 {
     Debug.Log("Exec");
     return(Task.CompletedTask);
 }
Beispiel #21
0
 public override async Task SetupAsync(WorkloadContext context)
 {
     client = new Greeter.GreeterClient(channel);
 }
 public ExtractOperationContextFromMessageMetadataStepFixture SetupWorkloadContextToContainOperationCtx()
 {
     WorkloadContext.AddItem(OperationContext.MetaName, FakeOperationContext);
     return(this);
 }