Skip to content

Commit 6461da0

Browse files
committed
fix integration tests
Signed-off-by: Erwin <erwinkramer@hotmail.com>
1 parent c8e42a7 commit 6461da0

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

test/CloudNative.CloudEvents.IntegrationTests/AspNetCore/CloudEventControllerTests.cs renamed to test/CloudNative.CloudEvents.IntegrationTests/AspNetCore/CloudEventBindingTests.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
// Licensed under the Apache 2.0 license.
33
// See LICENSE file in the project root for full license information.
44

5-
using CloudNative.CloudEvents.AspNetCoreSample;
65
using CloudNative.CloudEvents.Http;
7-
using CloudNative.CloudEvents.NewtonsoftJson;
6+
using CloudNative.CloudEvents.SystemTextJson;
87
using Microsoft.AspNetCore.Mvc.Testing;
98
using System;
109
using System.Net;
@@ -13,19 +12,19 @@
1312

1413
namespace CloudNative.CloudEvents.IntegrationTests.AspNetCore
1514
{
16-
public class CloudEventControllerTests : IClassFixture<WebApplicationFactory<Program>>
15+
public class CloudEventBindingTests : IClassFixture<WebApplicationFactory<Program>>
1716
{
1817
private readonly WebApplicationFactory<Program> _factory;
1918

20-
public CloudEventControllerTests(WebApplicationFactory<Program> factory)
19+
public CloudEventBindingTests(WebApplicationFactory<Program> factory)
2120
{
2221
_factory = factory;
2322
}
2423

2524
[Theory]
2625
[InlineData(ContentMode.Structured)]
2726
[InlineData(ContentMode.Binary)]
28-
public async Task Controller_WithValidCloudEvent_NoContent_DeserializesUsingPipeline(ContentMode contentMode)
27+
public async Task Binding_WithValidCloudEvent_NoContent_DeserializesUsingPipeline(ContentMode contentMode)
2928
{
3029
// Arrange
3130
var expectedExtensionKey = "comexampleextension1";
@@ -50,7 +49,7 @@ public async Task Controller_WithValidCloudEvent_NoContent_DeserializesUsingPipe
5049
Assert.Equal(HttpStatusCode.OK, result.StatusCode);
5150
Assert.Contains(cloudEvent.Id, resultContent);
5251
Assert.Contains(cloudEvent.Type, resultContent);
53-
Assert.Contains($"\"{expectedExtensionKey}\": \"{expectedExtensionValue}\"", resultContent);
52+
Assert.Contains($"\"{expectedExtensionKey}\":\"{expectedExtensionValue}\"", resultContent);
5453
}
5554
}
5655
}

test/CloudNative.CloudEvents.IntegrationTests/CloudNative.CloudEvents.IntegrationTests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>net10.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
8+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" VersionOverride="10.0.5" /> <!-- VersionOverride is needed to avoid pulling in a later version of Microsoft.AspNetCore.App that isn't compatible with .NET 10.0. -->
99
<PackageReference Include="Microsoft.NET.Test.Sdk" />
1010
<PackageReference Include="xunit" />
1111
<PackageReference Include="xunit.runner.visualstudio">

0 commit comments

Comments
 (0)