2 implementations of Eventing
Aspire.Hosting.Testing (2)
244 references to Eventing
Aspire.Hosting.Azure.EntraId.Tests (9)
EntraIdProvisioningTests.cs (9)
1173await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
1287await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
1314await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
1339var publish = builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(web.Resource, app.Services), cts.Token);
1382await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(web.Resource, app.Services), CancellationToken.None);
1400await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
1458await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
1491await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
1512await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
Aspire.Hosting.Azure.Kusto.Tests (1)
Aspire.Hosting.Azure.Tests (9)
Aspire.Hosting.DevTunnels.Tests (2)
Aspire.Hosting.Dotnet.Tests (45)
Aspire.Hosting.EntityFrameworkCore.Tests (2)
Aspire.Hosting.Foundry.Tests (1)
Aspire.Hosting.Garnet.Tests (1)
Aspire.Hosting.Go.Tests (3)
Aspire.Hosting.Java.Tests (16)
Aspire.Hosting.Kafka.Tests (4)
Aspire.Hosting.Keycloak.Tests (1)
Aspire.Hosting.Maui.Tests (3)
Aspire.Hosting.MongoDB.Tests (12)
AddMongoDBTests.cs (10)
141await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, app.Services.GetRequiredService<DistributedApplicationModel>()));
171await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, app.Services.GetRequiredService<DistributedApplicationModel>()));
499await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
524await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
550await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
571await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
609await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
650await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
670await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
688await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
Aspire.Hosting.MySql.Tests (1)
Aspire.Hosting.OpenAI.Tests (2)
Aspire.Hosting.Qdrant.Tests (1)
Aspire.Hosting.Redis.Tests (3)
Aspire.Hosting.SqlServer.Tests (3)
Aspire.Hosting.Testing.Tests (1)
Aspire.Hosting.Tests (122)
Eventing\DistributedApplicationBuilderEventingTests.cs (24)
27builder.Eventing.Subscribe<DummyEvent>(async (_, ct) =>
38await builder.Eventing.PublishAsync(new DummyEvent(), EventDispatchBehavior.NonBlockingConcurrent, cts.Token).DefaultTimeout();
59builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) =>
66builder.Eventing.Subscribe<DummyEvent>((@event, ct) =>
72var pendingPublish = builder.Eventing.PublishAsync(new DummyEvent(), EventDispatchBehavior.BlockingSequential);
91builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) =>
98builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) =>
105var pendingPublish = builder.Eventing.PublishAsync(new DummyEvent(), EventDispatchBehavior.BlockingConcurrent);
123builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) =>
130builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) =>
137await builder.Eventing.PublishAsync(new DummyEvent(), EventDispatchBehavior.NonBlockingConcurrent).DefaultTimeout();
156builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) =>
165builder.Eventing.Subscribe<DummyEvent>((@event, ct) =>
172await builder.Eventing.PublishAsync(new DummyEvent(), EventDispatchBehavior.NonBlockingSequential).DefaultTimeout();
205Assert.Equal(builder.Eventing, eventing);
243builder.Eventing.Subscribe<BeforeResourceStartedEvent>((e, ct) =>
268builder.Eventing.Subscribe<BeforeStartEvent>((e, ct) =>
276builder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) =>
284builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) =>
313builder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => Task.CompletedTask);
428builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) =>
524builder.Eventing.Subscribe<IDistributedApplicationEvent>((_, _) => Task.CompletedTask));
536builder.Eventing.Subscribe<AbstractDummyEvent>((_, _) => Task.CompletedTask));
549builder.Eventing.Subscribe<IDistributedApplicationResourceEvent>(resource.Resource, (_, _) => Task.CompletedTask));
Orchestrator\ApplicationOrchestratorTests.cs (42)
53applicationEventing: builder.Eventing);
57builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token);
105applicationEventing: builder.Eventing);
110builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout();
140applicationEventing: builder.Eventing);
144builder.Eventing, EventDispatchBehavior.BlockingSequential, default).DefaultTimeout();
176applicationEventing: builder.Eventing);
180builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout();
187builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout();
206applicationEventing: builder.Eventing);
210builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout();
214builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout();
245await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(frontend.Resource, app.Services), default);
271await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(frontend.Resource, app.Services), default);
311applicationEventing: builder.Eventing);
315[new(frontend.Resource, app.Services)], builder.Eventing, dispatchBehavior, cts.Token);
371applicationEventing: builder.Eventing, dashboardOptions: new() { DashboardUrl = dashboardUrl });
376await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
416applicationEventing: builder.Eventing);
418await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
419await orchestrator.PublishEndpointsAllocatedAsync([new(manager.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
443applicationEventing: builder.Eventing);
446var publish = orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
480applicationEventing: builder.Eventing);
482await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
501applicationEventing: builder.Eventing);
504await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default).DefaultTimeout();
528applicationEventing: builder.Eventing);
530await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
549applicationEventing: builder.Eventing);
551await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
577applicationEventing: builder.Eventing);
579await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
583await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
611var orchestrator = CreateOrchestrator(model, notificationService: notifications, dcpEvents: events, applicationEventing: builder.Eventing);
1159builder.Eventing.Subscribe<BeforeResourceStartedEvent>(resource, (_, _) =>
1166notifications, dcpEvents: events, applicationEventing: builder.Eventing);
1211builder.Eventing.Subscribe<ConnectionStringAvailableEvent>(replicaSet.Resource, (_, _) =>
1218var initialization = builder.Eventing.PublishAsync(new InitializeResourceEvent(
1220builder.Eventing,
1481applicationEventing: builder.Eventing);
1543applicationEventing: builder.Eventing,
WithTerminalTests.cs (14)
356await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
411await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
447await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
525await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
615await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
667await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
1063await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
1079await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
1097await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
1427await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
1449await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
1476await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
1498await Assert.ThrowsAsync<IOException>(async () => await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)));
1551await cleanupService.SubscribeAsync(builder.Eventing, executionContext, CancellationToken.None);
Aspire.Hosting.Yarp.Tests (2)