Skip to content

Commit

Permalink
Merge pull request #143 from baynezy/dependabot/nuget/NUnit-4.0.1
Browse files Browse the repository at this point in the history
Bump NUnit from 3.13.2 to 4.0.1
  • Loading branch information
baynezy authored Feb 13, 2024
2 parents 383f0af + 65cbe6a commit 750c6b7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
29 changes: 15 additions & 14 deletions test/DeepSecure.ThreatRemoval.Test/Comms/RequesterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Threading.Tasks;
using DeepSecure.ThreatRemoval.Comms;
using DeepSecure.ThreatRemoval.Model;
using FluentAssertions;
using NSubstitute;
using NUnit.Framework;
using RichardSzalay.MockHttp;
Expand Down Expand Up @@ -51,12 +52,12 @@ public void Sync_WhenApiRespondsWith500_ThenParseApiResponse()
var requester = CreateRequester(mockHttp);

var ex = Assert.ThrowsAsync<ApiRequestException>(() => requester.Sync(new byte[10], MimeType.ApplicationPdf));
Assert.NotNull(ex);
Assert.That(ex.ApiErrorResponse.Code, Is.EqualTo(errorResponse.Code));
Assert.That(ex.ApiErrorResponse.Message, Is.EqualTo(errorResponse.Message));
Assert.That(ex.ApiErrorResponse.Name, Is.EqualTo(errorResponse.Name));
Assert.That(ex.ApiErrorResponse.Path, Is.EqualTo(errorResponse.Path));
Assert.That(ex.ApiErrorResponse.Type, Is.EqualTo(errorResponse.Type));
ex.Should().NotBeNull();
ex!.ApiErrorResponse.Code.Should().Be(errorResponse.Code);
ex!.ApiErrorResponse.Message.Should().Be(errorResponse.Message);
ex!.ApiErrorResponse.Name.Should().Be(errorResponse.Name);
ex!.ApiErrorResponse.Path.Should().Be(errorResponse.Path);
ex!.ApiErrorResponse.Type.Should().Be(errorResponse.Type);
}

[Test]
Expand All @@ -67,8 +68,8 @@ public void Sync_WhenApiRespondsWith500_ThenReturnHttpRequestExceptionAsInnerExc
var requester = CreateRequester(mockHttp);

var ex = Assert.ThrowsAsync<ApiRequestException>(() => requester.Sync(new byte[10], MimeType.ApplicationPdf));
Assert.NotNull(ex);
Assert.That(ex.InnerException, Is.TypeOf<HttpRequestException>());
ex.Should().NotBeNull();
ex!.InnerException.Should().BeOfType<HttpRequestException>();
}

[Test]
Expand All @@ -79,8 +80,8 @@ public void Sync_WhenApiRespondsWith500_TheReturnThrowApiRequestExceptionError()
var requester = CreateRequester(mockHttp);

var ex = Assert.ThrowsAsync<ApiRequestException>(() => requester.Sync(new byte[10], MimeType.ApplicationPdf));
Assert.NotNull(ex);
Assert.That(ex.Message, Is.EqualTo("API Request Failed with a 500 response."));
ex.Should().NotBeNull();
ex!.Message.Should().Be("API Request Failed with a 500 response.");
}

[Test]
Expand All @@ -91,8 +92,8 @@ public void Sync_WhenApiRespondsWith400_TheReturnThrowApiRequestExceptionError()
var requester = CreateRequester(mockHttp);

var ex = Assert.ThrowsAsync<ApiRequestException>(() => requester.Sync(new byte[10], MimeType.ApplicationPdf));
Assert.NotNull(ex);
Assert.That(ex.Message, Is.EqualTo("API Request Failed with a 400 response."));
ex.Should().NotBeNull();
ex!.Message.Should().Be("API Request Failed with a 400 response.");
}

[Test]
Expand All @@ -103,8 +104,8 @@ public void Sync_WhenApiRespondsWith429_TheReturnThrowApiRequestExceptionError()
var requester = CreateRequester(mockHttp);

var ex = Assert.ThrowsAsync<ApiRequestException>(() => requester.Sync(new byte[10], MimeType.ApplicationPdf));
Assert.NotNull(ex);
Assert.That(ex.Message, Is.EqualTo("API Request Failed with a 429 response."));
ex.Should().NotBeNull();
ex!.Message.Should().Be("API Request Failed with a 429 response.");
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="JUnitTestLogger" Version="1.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RichardSzalay.MockHttp" Version="7.0.0" />
</ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions test/DeepSecure.ThreatRemoval.Test/Model/ConfigTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using DeepSecure.ThreatRemoval.Model;
using FluentAssertions;
using NUnit.Framework;

namespace DeepSecure.ThreatRemoval.Test.Model
Expand All @@ -22,8 +23,8 @@ public void Config_WhenConstructing_ThenSyncUrlIsMandatoryAndNotNullable()
const string apiKey = "qwerty123";

var ex = Assert.Throws<ArgumentNullException>(() => CreateConfig(syncUrl: syncUrl, apiKey:apiKey));
Assert.NotNull(ex);
Assert.That(ex.Message, Is.EqualTo("Value cannot be null. (Parameter 'SyncUrl')"));
ex.Should().NotBeNull();
ex!.Message.Should().Be("Value cannot be null. (Parameter 'SyncUrl')");
}

[Test]
Expand All @@ -33,8 +34,8 @@ public void Config_WhenConstructing_ThenApiKeyIsMandatoryAndNotNullable()
const string apiKey = null;

var ex = Assert.Throws<ArgumentNullException>(() => CreateConfig(syncUrl: syncUrl, apiKey:apiKey));
Assert.NotNull(ex);
Assert.That(ex.Message, Is.EqualTo("Value cannot be null. (Parameter 'ApiKey')"));
ex.Should().NotBeNull();
ex!.Message.Should().Be("Value cannot be null. (Parameter 'ApiKey')");
}

[Test]
Expand Down

0 comments on commit 750c6b7

Please sign in to comment.