Skip to content

Commit 5f83212

Browse files
kristremblayFullStackChef
authored andcommitted
add test for no wait annotations
1 parent 9436099 commit 5f83212

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/CommunityToolkit.Aspire.Hosting.Dapr.Tests/WithDaprSidecarTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,25 @@ public void DaprSidecarCanReferenceComponents()
111111
Assert.Contains(referenceAnnotations, a => a.Component.Name == "pubsub");
112112
}
113113

114+
[Fact]
115+
public void ResourceWithDaprSidecarAndNoWaitAnnotations_CreatesBasicSidecar()
116+
{
117+
var builder = DistributedApplication.CreateBuilder();
118+
119+
var app = builder.AddProject<Projects.CommunityToolkit_Aspire_Hosting_Dapr_ServiceA>("test")
120+
.WithDaprSidecar();
121+
122+
// Verify no wait annotations on the main resource
123+
Assert.Empty(app.Resource.Annotations.OfType<WaitAnnotation>());
124+
125+
// Verify the sidecar resource exists
126+
var sidecarResource = Assert.Single(builder.Resources.OfType<DaprSidecarResource>());
127+
128+
// Verify the sidecar is properly linked
129+
var sidecarAnnotation = Assert.Single(app.Resource.Annotations.OfType<DaprSidecarAnnotation>());
130+
Assert.Equal(sidecarResource, sidecarAnnotation.Sidecar);
131+
}
132+
114133
[Fact]
115134
public void ResourceWithWaitAnnotationAndDaprSidecar_SetsUpCorrectDependencies()
116135
{

0 commit comments

Comments
 (0)