Skip to content

Commit

Permalink
Fixed several unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Whit Waldo <[email protected]>
  • Loading branch information
WhitWaldo committed Jan 18, 2025
1 parent 3d7ee3c commit e33a029
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ public async Task InvokeAsync_ForwardsJsonPropertiesAsHeaders(string dataContent
ReadBody(httpContext.Request.Body).ShouldBe("{\"name\":\"jimmy\"}");

httpContext.Request.Headers.ShouldContainKey("Cloudevent.type");
httpContext.Request.Headers["Cloudevent.type"].ShouldBeEquivalentTo("Test.Type");
httpContext.Request.Headers["Cloudevent.type"].ToString().ShouldBe("Test.Type");
httpContext.Request.Headers.ShouldContainKey("Cloudevent.subject");
httpContext.Request.Headers["Cloudevent.subject"].ShouldBeEquivalentTo("Test.Subject");
httpContext.Request.Headers["Cloudevent.subject"].ToString().ShouldBe("Test.Subject");
return Task.CompletedTask;
});

Expand Down Expand Up @@ -213,7 +213,7 @@ public async Task InvokeAsync_ForwardsIncludedJsonPropertiesAsHeaders(string dat
ReadBody(httpContext.Request.Body).ShouldBe("{\"name\":\"jimmy\"}");

httpContext.Request.Headers.ShouldContainKey("Cloudevent.type");
httpContext.Request.Headers["Cloudevent.type"].ShouldBeEquivalentTo("Test.Type");
httpContext.Request.Headers["Cloudevent.type"].ToString().ShouldBe("Test.Type");
httpContext.Request.Headers.ShouldNotContainKey("Cloudevent.subject");
return Task.CompletedTask;
});
Expand Down Expand Up @@ -262,7 +262,7 @@ public async Task InvokeAsync_DoesNotForwardExcludedJsonPropertiesAsHeaders(stri

httpContext.Request.Headers.ShouldNotContainKey("Cloudevent.type");
httpContext.Request.Headers.ShouldContainKey("Cloudevent.subject");
httpContext.Request.Headers["Cloudevent.subject"].ShouldBeEquivalentTo("Test.Subject");
httpContext.Request.Headers["Cloudevent.subject"].ToString().ShouldBe("Test.Subject");
return Task.CompletedTask;
});

Expand Down

0 comments on commit e33a029

Please sign in to comment.