Skip to content

Commit 27a986c

Browse files
Copilotbaywet
andcommitted
Replace FluentAssertions with Assert.Equivalent in MediaType tests
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
1 parent 73c3353 commit 27a986c

File tree

2 files changed

+22
-26
lines changed

2 files changed

+22
-26
lines changed

test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiMediaTypeTests.cs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System.IO;
55
using System.Threading.Tasks;
6-
using FluentAssertions;
76
using Microsoft.OpenApi.Reader;
87
using Microsoft.OpenApi.Tests;
98
using Xunit;
@@ -26,20 +25,19 @@ public async Task ParseMediaTypeWithXOaiItemSchemaShouldSucceed()
2625
SettingsFixture.ReaderSettings);
2726

2827
// Assert
29-
mediaType.Should().BeEquivalentTo(
30-
new OpenApiMediaType
28+
var expected = new OpenApiMediaType
29+
{
30+
Schema = new OpenApiSchema
3131
{
32-
Schema = new OpenApiSchema
33-
{
34-
Type = JsonSchemaType.Array
35-
},
36-
ItemSchema = new OpenApiSchema
37-
{
38-
Type = JsonSchemaType.String,
39-
MaxLength = 100
40-
}
32+
Type = JsonSchemaType.Array
4133
},
42-
options => options.IgnoringCyclicReferences());
34+
ItemSchema = new OpenApiSchema
35+
{
36+
Type = JsonSchemaType.String,
37+
MaxLength = 100
38+
}
39+
};
40+
Assert.Equivalent(expected, mediaType);
4341
}
4442
}
4543
}

test/Microsoft.OpenApi.Readers.Tests/V32Tests/OpenApiMediaTypeTests.cs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System.IO;
55
using System.Threading.Tasks;
6-
using FluentAssertions;
76
using Microsoft.OpenApi.Reader;
87
using Microsoft.OpenApi.Tests;
98
using Xunit;
@@ -26,20 +25,19 @@ public async Task ParseMediaTypeWithItemSchemaShouldSucceed()
2625
SettingsFixture.ReaderSettings);
2726

2827
// Assert
29-
mediaType.Should().BeEquivalentTo(
30-
new OpenApiMediaType
28+
var expected = new OpenApiMediaType
29+
{
30+
Schema = new OpenApiSchema
3131
{
32-
Schema = new OpenApiSchema
33-
{
34-
Type = JsonSchemaType.Array
35-
},
36-
ItemSchema = new OpenApiSchema
37-
{
38-
Type = JsonSchemaType.String,
39-
MaxLength = 100
40-
}
32+
Type = JsonSchemaType.Array
4133
},
42-
options => options.IgnoringCyclicReferences());
34+
ItemSchema = new OpenApiSchema
35+
{
36+
Type = JsonSchemaType.String,
37+
MaxLength = 100
38+
}
39+
};
40+
Assert.Equivalent(expected, mediaType);
4341
}
4442
}
4543
}

0 commit comments

Comments
 (0)