Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump NUnit from 3.13.3 to 4.3.2 #57

Merged
merged 2 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/Criteo.OpenApi.Comparator.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,7 @@ private static void DisplayOutput(IEnumerable<ComparisonMessage> differences, Ou
{
if (outputFormat == OutputFormat.Json)
{
var serializerOptions = new JsonSerializerOptions
{
WriteIndented = true,
Converters = { new JsonStringEnumConverter() },
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
};
Console.WriteLine(JsonSerializer.Serialize(differences, serializerOptions));
Console.WriteLine(JsonSerializer.Serialize(differences, SerializationOptions));
return;
}

Expand All @@ -154,5 +148,12 @@ private static void DisplayOutput(IEnumerable<ComparisonMessage> differences, Ou
}
}
}

private static readonly JsonSerializerOptions SerializationOptions = new()
{
WriteIndented = true,
Converters = { new JsonStringEnumConverter() },
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Criteo.OpenApi.Comparator.UTest/OpenApiParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void OpenApiParser_Should_Return_Valid_OpenApi_Document_Object(string fil
{
var documentAsString = ReadOpenApiFile(fileName);
var validOpenApiDocument = OpenApiParser.Parse(documentAsString, out _);
Assert.IsInstanceOf<JsonDocument<OpenApiDocument>>(validOpenApiDocument);
Assert.That(validOpenApiDocument, Is.InstanceOf<JsonDocument<OpenApiDocument>>());
}
}
}
28 changes: 14 additions & 14 deletions src/Criteo.OpenApi.Comparator.UTest/PrimitiveTypesExtensionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,110 +15,110 @@ public void DifferFrom_ShouldReturn_false_When_SameString()
{
const string oldString = "string";
const string newString = "string";
Assert.IsFalse(oldString.DifferFrom(newString));
Assert.That(oldString.DifferFrom(newString), Is.False);
}

[Test]
public void DifferFrom_ShouldReturn_false_When_NullString()
{
const string oldString = null;
const string newString = null;
Assert.IsFalse(oldString.DifferFrom(newString));
Assert.That(oldString.DifferFrom(newString), Is.False);
}

[Test]
public void DifferFrom_ShouldReturn_true_When_NullOldString()
{
const string oldString = null;
const string newString = "string";
Assert.IsTrue(oldString.DifferFrom(newString));
Assert.That(oldString.DifferFrom(newString), Is.True);
}

[Test]
public void DifferFrom_ShouldReturn_true_When_NullNewString()
{
const string oldString = "string";
const string newString = null;
Assert.IsTrue(oldString.DifferFrom(newString));
Assert.That(oldString.DifferFrom(newString), Is.True);
}

[Test]
public void DifferFrom_ShouldReturn_false_When_SameInteger()
{
int? oldInteger = 8;
int? newInteger = 8;
Assert.IsFalse(oldInteger.DifferFrom(newInteger));
Assert.That(oldInteger.DifferFrom(newInteger), Is.False);
}

[Test]
public void DifferFrom_ShouldReturn_false_When_NullInteger()
{
int? oldInteger = null;
int? newInteger = null;
Assert.IsFalse(oldInteger.DifferFrom(newInteger));
Assert.That(oldInteger.DifferFrom(newInteger), Is.False);
}

[Test]
public void DifferFrom_ShouldReturn_true_When_NullOldInteger()
{
int? oldInteger = null;
int? newInteger = 8;
Assert.IsTrue(oldInteger.DifferFrom(newInteger));
Assert.That(oldInteger.DifferFrom(newInteger), Is.True);
}

[Test]
public void DifferFrom_ShouldReturn_true_When_NullNewInteger()
{
int? oldInteger = 8;
Assert.IsTrue(oldInteger.DifferFrom(null));
Assert.That(oldInteger.DifferFrom(null), Is.True);
}

[Test]
public void DifferFrom_ShouldReturn_false_When_SameOpenApiInteger()
{
var oldInteger = new OpenApiInteger(8);
var newInteger = new OpenApiInteger(8);
Assert.IsFalse(oldInteger.DifferFrom(newInteger));
Assert.That(oldInteger.DifferFrom(newInteger), Is.False);
}

[Test]
public void DifferFrom_ShouldReturn_true_When_DifferentOpenApiInteger()
{
var oldInteger = new OpenApiInteger(8);
var newInteger = new OpenApiInteger(1);
Assert.IsTrue(oldInteger.DifferFrom(newInteger));
Assert.That(oldInteger.DifferFrom(newInteger), Is.True);
}

[Test]
public void DifferFrom_ShouldReturn_false_When_SameOpenApiBoolean()
{
var oldBoolean = new OpenApiBoolean(false);
var newBoolean = new OpenApiBoolean(false);
Assert.IsFalse(oldBoolean.DifferFrom(newBoolean));
Assert.That(oldBoolean.DifferFrom(newBoolean), Is.False);
}

[Test]
public void DifferFrom_ShouldReturn_true_When_DifferentOpenApiBoolean()
{
var oldBoolean = new OpenApiBoolean(false);
var newBoolean = new OpenApiBoolean(true);
Assert.IsTrue(oldBoolean.DifferFrom(newBoolean));
Assert.That(oldBoolean.DifferFrom(newBoolean), Is.True);
}

[Test]
public void DifferFrom_ShouldReturn_false_When_SameOpenApiString()
{
var oldString = new OpenApiString("string");
var newString = new OpenApiString("string");
Assert.IsFalse(oldString.DifferFrom(newString));
Assert.That(oldString.DifferFrom(newString), Is.False);
}

[Test]
public void DifferFrom_ShouldReturn_true_When_DifferentOpenApiString()
{
var oldString = new OpenApiString("oldString");
var newString = new OpenApiString("newString");
Assert.IsTrue(oldString.DifferFrom(newString));
Assert.That(oldString.DifferFrom(newString), Is.True);
}
}
}