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

Bump xunit from 2.5.0 to 2.7.0 #1362

Merged
merged 2 commits into from
Mar 13, 2024
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
2 changes: 1 addition & 1 deletion GetIntoTeachingApiTests/GetIntoTeachingApiTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="WireMock.Net" Version="1.5.39" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ public void BindModelAsync_WithNullContext_ThrowsArgumentNullException()
}

[Fact]
public void BindModelAsync_WhenValueProviderResultIsNone_CompletesTask()
public async Task BindModelAsync_WhenValueProviderResultIsNone_CompletesTask()
{
_mockValueProvider.Setup(m => m.GetValue("key")).Returns(ValueProviderResult.None);

var task = _binder.BindModelAsync(_mockContext.Object);

task.Wait();
// task.Wait();
await task;
task.Should().Be(Task.CompletedTask);
}

[Fact]
public void BindModelAsync_WhenValueIsString_TrimsStringAndCompletesTask()
public async Task BindModelAsync_WhenValueIsString_TrimsStringAndCompletesTask()
{
var modelState = new ModelStateDictionary();
var valueProviderResult = new ValueProviderResult(" value ");
Expand All @@ -51,7 +52,8 @@ public void BindModelAsync_WhenValueIsString_TrimsStringAndCompletesTask()

var task = _binder.BindModelAsync(_mockContext.Object);

task.Wait();
// task.Wait();
await task;
task.Should().Be(Task.CompletedTask);
_mockContext.VerifySet(m => m.Result = ModelBindingResult.Success("value"));
}
Expand Down
5 changes: 3 additions & 2 deletions GetIntoTeachingApiTests/Services/NotifyServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using GetIntoTeachingApi.Models;
using GetIntoTeachingApi.Utils;
using Xunit;
using System.Threading.Tasks;

namespace GetIntoTeachingApiTests.Services
{
Expand Down Expand Up @@ -68,7 +69,7 @@ public void SendEmail_SendsAnEmail(string templateId, string templateDescription
}

[Fact]
public void SendEmailAsync_WhenSendingFails_LogsException()
public async Task SendEmailAsync_WhenSendingFails_LogsException()
{
_mockNotificationClient.Setup(
mock => mock.SendEmailAsync(
Expand All @@ -79,7 +80,7 @@ public void SendEmailAsync_WhenSendingFails_LogsException()
)
).ThrowsAsync(new Exception("bang"));

_service.SendEmailAsync("[email protected]", NotifyService.NewPinCodeEmailTemplateId, _personalisation).Wait();
await _service.SendEmailAsync("[email protected]", NotifyService.NewPinCodeEmailTemplateId, _personalisation);

_mockLogger.VerifyWarningWasCalled("NotifyService - Failed to send email");
}
Expand Down
Loading