2 implementations of Eventing
Aspire.Hosting.Testing (2)
218 references to Eventing
Aspire.Hosting.Azure.EntraId.Tests (9)
EntraIdProvisioningTests.cs (9)
1172await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
1286await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
1313await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
1338var publish = builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(web.Resource, app.Services), cts.Token);
1381await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(web.Resource, app.Services), CancellationToken.None);
1399await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
1457await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
1490await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
1511await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
Aspire.Hosting.Azure.Tests (7)
Aspire.Hosting.DevTunnels.Tests (2)
Aspire.Hosting.Dotnet.Tests (39)
Aspire.Hosting.EntityFrameworkCore.Tests (2)
Aspire.Hosting.Foundry.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)
140await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, app.Services.GetRequiredService<DistributedApplicationModel>()));
170await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, app.Services.GetRequiredService<DistributedApplicationModel>()));
469await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
494await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
520await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
541await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
579await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
620await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
640await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
658await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
Aspire.Hosting.MySql.Tests (1)
Aspire.Hosting.Qdrant.Tests (1)
Aspire.Hosting.Redis.Tests (3)
Aspire.Hosting.SqlServer.Tests (2)
Aspire.Hosting.Testing.Tests (1)
Aspire.Hosting.Tests (109)
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 (33)
46applicationEventing: builder.Eventing);
51builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout();
81applicationEventing: builder.Eventing);
85builder.Eventing, EventDispatchBehavior.BlockingSequential, default).DefaultTimeout();
117applicationEventing: builder.Eventing);
121builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout();
128builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout();
147applicationEventing: builder.Eventing);
151builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout();
155builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout();
186await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(frontend.Resource, app.Services), default);
212await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(frontend.Resource, app.Services), default);
252applicationEventing: builder.Eventing);
256[new(frontend.Resource, app.Services)], builder.Eventing, dispatchBehavior, cts.Token);
312applicationEventing: builder.Eventing, dashboardOptions: new() { DashboardUrl = dashboardUrl });
317await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
357applicationEventing: builder.Eventing);
359await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
360await orchestrator.PublishEndpointsAllocatedAsync([new(manager.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
384applicationEventing: builder.Eventing);
387var publish = orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
421applicationEventing: builder.Eventing);
423await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
442applicationEventing: builder.Eventing);
445await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default).DefaultTimeout();
469applicationEventing: builder.Eventing);
471await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
490applicationEventing: builder.Eventing);
492await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
518applicationEventing: builder.Eventing);
520await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
524await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
552var orchestrator = CreateOrchestrator(model, notificationService: notifications, dcpEvents: events, applicationEventing: 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)