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.8.1 #3599

Merged
merged 7 commits into from
Jun 12, 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
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@
<PackageVersion Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Private.ServiceModel" Version="4.10.3" />
<PackageVersion Include="xunit.extensibility.core" Version="2.5.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageVersion Include="xunit.extensibility.core" Version="2.8.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
<PackageVersion Include="xunit" Version="2.5.0" />
<PackageVersion Include="xunit.assert" Version="2.7.0" />
<PackageVersion Include="xunit" Version="2.8.1" />
<PackageVersion Include="xunit.assert" Version="2.8.1" />
<PackageVersion Include="System.Drawing.Common" Version="8.0.6" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ protected override Task<RunSummary> RunTestMethodsAsync()
/// the synthetic classes that we created of the form Namespace.Class(Arg1, Arg2). For these, we want to create a
/// <see cref="TestClassWithFixtureArgumentsTypeInfo"/> with Arg1 and Arg2 as the fixture arguments
/// </summary>
private sealed class CustomAssemblyInfo : IAssemblyInfo
private sealed class CustomAssemblyInfo : LongLivedMarshalByRefObject, IAssemblyInfo
{
private readonly IAssemblyInfo _assemblyInfoImplementation;
private readonly Regex _argumentsRegex = new Regex(@"\((\s*(?<VALUE>[^, )]+)\s*,?)*\)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.Linq;
using EnsureThat;
using Xunit;
using Xunit.Abstractions;
using Xunit.Sdk;

Expand All @@ -16,7 +17,7 @@ namespace Microsoft.Health.Extensions.Xunit
/// A special <see cref="ITypeInfo"/> for a test class that will use a fixture instantiated with with a single set of constructor arguments.
/// The <see cref="Name"/> property is customized to be of the form Namespace.Class(Arg1, Arg2)
/// </summary>
public class TestClassWithFixtureArgumentsTypeInfo : IReflectionTypeInfo
public class TestClassWithFixtureArgumentsTypeInfo : LongLivedMarshalByRefObject, IReflectionTypeInfo
{
private readonly ITypeInfo _typeInfoImplementation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class FhirSchemaClientTests
private readonly ISchemaManagerDataStore _schemaManagerDataStore = Substitute.For<ISchemaManagerDataStore>();

[Fact]
public async void GivenCurrentVersionAboveOne_GetAvailableVersions_ShouldReturnCorrectVersionsAsync()
public async Task GivenCurrentVersionAboveOne_GetAvailableVersions_ShouldReturnCorrectVersionsAsync()
{
// Arrange
int currentVersion = 5;
Expand All @@ -45,7 +45,7 @@ public async void GivenCurrentVersionAboveOne_GetAvailableVersions_ShouldReturnC
}

[Fact]
public async void GivenCurrentVersionOfMax_GetAvailableVersionsShouldReturnOneVersion()
public async Task GivenCurrentVersionOfMax_GetAvailableVersionsShouldReturnOneVersion()
{
// Arrange
_schemaManagerDataStore.GetCurrentSchemaVersionAsync(default).Returns(SchemaVersionConstants.Max);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Hl7.Fhir.Model;
using MediatR;
using Microsoft.AspNetCore.Http;
Expand All @@ -25,6 +26,7 @@
using NSubstitute;
using Xunit;
using static Hl7.Fhir.Model.Parameters;
using Task = System.Threading.Tasks.Task;

namespace Microsoft.Health.Fhir.Api.UnitTests.Controllers
{
Expand Down Expand Up @@ -55,20 +57,20 @@ public SearchParameterControllerTests()
}

[Fact]
public async void GivenASearchParameterStatusRequest_WhenSupportsSelectableSearchParametersFlagIsFalse_ThenRequestNotValidExceptionShouldBeReturned()
public async Task GivenASearchParameterStatusRequest_WhenSupportsSelectableSearchParametersFlagIsFalse_ThenRequestNotValidExceptionShouldBeReturned()
{
CoreFeatureConfiguration coreFeaturesConfiguration = new CoreFeatureConfiguration();
coreFeaturesConfiguration.SupportsSelectableSearchParameters = false;

SearchParameterController controller = new SearchParameterController(_mediator, Options.Create(coreFeaturesConfiguration), _fhirConfiguration);

Func<System.Threading.Tasks.Task> act = () => controller.GetSearchParametersStatus(default(CancellationToken));
Func<Task> act = () => controller.GetSearchParametersStatus(default(CancellationToken));

var exception = await Assert.ThrowsAsync<RequestNotValidException>(act);
}

[Fact]
public async void GivenASearchParameterStatusRequest_WhenSupportsSelectableSearchParametersFlagIsTrue_ThenMediatorShouldBeCalled()
public async Task GivenASearchParameterStatusRequest_WhenSupportsSelectableSearchParametersFlagIsTrue_ThenMediatorShouldBeCalled()
{
try
{
Expand All @@ -82,7 +84,7 @@ public async void GivenASearchParameterStatusRequest_WhenSupportsSelectableSearc
}

[Fact]
public async void GivenAnInvalidUpdateRequestBody_WhenParsingRequestBody_RequestNotValidExceptionIsThrown()
public async Task GivenAnInvalidUpdateRequestBody_WhenParsingRequestBody_RequestNotValidExceptionIsThrown()
{
var requestBody = CreateInvalidRequestBody();

Expand All @@ -92,7 +94,7 @@ public async void GivenAnInvalidUpdateRequestBody_WhenParsingRequestBody_Request
}

[Fact]
public async void GivenAValidSearchParameterStatusUpdateRequest_WhenSupportsSelectableSearchParametersFlagIsFalse_ThenRequestNotValidExceptionShouldBeReturned()
public async Task GivenAValidSearchParameterStatusUpdateRequest_WhenSupportsSelectableSearchParametersFlagIsFalse_ThenRequestNotValidExceptionShouldBeReturned()
{
CoreFeatureConfiguration coreFeaturesConfiguration = new CoreFeatureConfiguration();
coreFeaturesConfiguration.SupportsSelectableSearchParameters = false;
Expand All @@ -105,7 +107,7 @@ public async void GivenAValidSearchParameterStatusUpdateRequest_WhenSupportsSele
}

[Fact]
public async void GivenAValidSearchParameterStatusUpdateRequest_WhenServiceIsAzureApiForFhir_ThenRequestNotValidExceptionShouldBeReturned()
public async Task GivenAValidSearchParameterStatusUpdateRequest_WhenServiceIsAzureApiForFhir_ThenRequestNotValidExceptionShouldBeReturned()
{
AzureApiForFhirRuntimeConfiguration azureApiForFhirConfiguration = new AzureApiForFhirRuntimeConfiguration();
SearchParameterController controller = new SearchParameterController(_mediator, Options.Create(_coreFeaturesConfiguration), azureApiForFhirConfiguration);
Expand All @@ -116,7 +118,7 @@ public async void GivenAValidSearchParameterStatusUpdateRequest_WhenServiceIsAzu
}

[Fact]
public async void GivenAValidRequestBody_WhenParsingRequestBody_MediatorShouldBeCalled()
public async Task GivenAValidRequestBody_WhenParsingRequestBody_MediatorShouldBeCalled()
{
var requestBody = CreateValidRequestBody();

Expand All @@ -132,7 +134,7 @@ public async void GivenAValidRequestBody_WhenParsingRequestBody_MediatorShouldBe
}

[Fact]
public async void GivenAValidRequestBody_WhenParsingRequestBody_MediatorShouldBeCalledWithCorrectParameters()
public async Task GivenAValidRequestBody_WhenParsingRequestBody_MediatorShouldBeCalledWithCorrectParameters()
{
var requestBody = CreateValidRequestBody();
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Microsoft.Health.Fhir.Api.UnitTests.Features.Filters.Metrics
public sealed class MetricEmitterAttributeTests
{
[Fact]
public async void BundleEndpointMetricEmitterAttribute_WhenCalled_EmittsMetrics()
public async Task BundleEndpointMetricEmitterAttribute_WhenCalled_EmittsMetrics()
{
IBundleMetricHandler metricHandler = Substitute.For<IBundleMetricHandler>();
metricHandler.EmitLatency(Arg.Any<BundleMetricNotification>());
Expand All @@ -33,7 +33,7 @@ public async void BundleEndpointMetricEmitterAttribute_WhenCalled_EmittsMetrics(
}

[Fact]
public async void SearchEndpointMetricEmitterAttribute_WhenCalled_EmittsMetrics()
public async Task SearchEndpointMetricEmitterAttribute_WhenCalled_EmittsMetrics()
{
ISearchMetricHandler metricHandler = Substitute.For<ISearchMetricHandler>();
metricHandler.EmitLatency(Arg.Any<SearchMetricNotification>());
Expand All @@ -48,7 +48,7 @@ public async void SearchEndpointMetricEmitterAttribute_WhenCalled_EmittsMetrics(
}

[Fact]
public async void CrudEndpointMetricEmitterAttribute_WhenCalled_EmittsMetrics()
public async Task CrudEndpointMetricEmitterAttribute_WhenCalled_EmittsMetrics()
{
ICrudMetricHandler metricHandler = Substitute.For<ICrudMetricHandler>();
metricHandler.EmitLatency(Arg.Any<CrudMetricNotification>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using NSubstitute;
using Xunit;
using ResourceVersionPolicy = Hl7.Fhir.Model.CapabilityStatement.ResourceVersionPolicy;
using Task = System.Threading.Tasks.Task;

namespace Microsoft.Health.Fhir.Core.UnitTests.Features.Conformance
{
Expand All @@ -31,7 +32,7 @@ public ConformanceProviderExtensionTests()
[InlineData(ResourceVersionPolicy.NoVersion, false)]
[InlineData(ResourceVersionPolicy.Versioned, true)]
[InlineData(ResourceVersionPolicy.VersionedUpdate, true)]
public async void GivenCoreConfigWithVersioningPolicy_WhenCheckingIfKeepHistory_ThenCorrectValueIsReturned(ResourceVersionPolicy versioningPolicy, bool expectedKeepHistory)
public async Task GivenCoreConfigWithVersioningPolicy_WhenCheckingIfKeepHistory_ThenCorrectValueIsReturned(ResourceVersionPolicy versioningPolicy, bool expectedKeepHistory)
{
const ResourceType resourceType = ResourceType.Patient;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
using Microsoft.Health.Test.Utilities;
using NSubstitute;
using Xunit;
using Task = System.Threading.Tasks.Task;

namespace Microsoft.Health.Fhir.Shared.Core.UnitTests.Features.Operations.SearchParameterState
{
Expand Down Expand Up @@ -173,7 +174,7 @@ public SearchParameterStateHandlerTests()
}

[Fact]
public async void GivenARequestWithNoQueries_WhenHandling_ThenAllSearchParametersAreReturned()
public async Task GivenARequestWithNoQueries_WhenHandling_ThenAllSearchParametersAreReturned()
{
// Arrange
var request = new SearchParameterStateRequest(new List<Tuple<string, string>>());
Expand All @@ -196,7 +197,7 @@ public async void GivenARequestWithNoQueries_WhenHandling_ThenAllSearchParameter
}

[Fact]
public async void GivenARequestWithAValidUrl_WhenHandling_ThenSearchParameterMatchingUrlIsReturned()
public async Task GivenARequestWithAValidUrl_WhenHandling_ThenSearchParameterMatchingUrlIsReturned()
{
// Arrange
var request = new SearchParameterStateRequest(new List<Tuple<string, string>>() { new Tuple<string, string>(SearchParameterStateProperties.Url, ResourceId) });
Expand All @@ -213,7 +214,7 @@ public async void GivenARequestWithAValidUrl_WhenHandling_ThenSearchParameterMat
}

[Fact]
public async void GivenARequestWithAValidCode_WhenHandling_ThenSearchParameterMatchingCodeIsReturned()
public async Task GivenARequestWithAValidCode_WhenHandling_ThenSearchParameterMatchingCodeIsReturned()
{
// Arrange
var request = new SearchParameterStateRequest(new List<Tuple<string, string>>() { new Tuple<string, string>(SearchParameterStateProperties.Code, "lastUpdated") });
Expand All @@ -231,7 +232,7 @@ public async void GivenARequestWithAValidCode_WhenHandling_ThenSearchParameterMa
}

[Fact]
public async void GivenARequestWithAValidResourceType_WhenHandling_ThenSearchParametersMatchingResourceTypeAreReturned()
public async Task GivenARequestWithAValidResourceType_WhenHandling_ThenSearchParametersMatchingResourceTypeAreReturned()
{
// Arrange
var request = new SearchParameterStateRequest(new List<Tuple<string, string>>() { new Tuple<string, string>(SearchParameterStateProperties.ResourceType, "Resource") });
Expand All @@ -252,7 +253,7 @@ public async void GivenARequestWithAValidResourceType_WhenHandling_ThenSearchPar
}

[Fact]
public async void GivenARequestWithAValidCodeAndResourceType_WhenHandling_ThenSearchParameterMatchingCodeAndResourceTypeIsReturned()
public async Task GivenARequestWithAValidCodeAndResourceType_WhenHandling_ThenSearchParameterMatchingCodeAndResourceTypeIsReturned()
{
// Arrange
var request = new SearchParameterStateRequest(new List<Tuple<string, string>>() { new Tuple<string, string>(SearchParameterStateProperties.Code, "lastUpdated"), new Tuple<string, string>(SearchParameterStateProperties.ResourceType, "Resource") });
Expand All @@ -269,7 +270,7 @@ public async void GivenARequestWithAValidCodeAndResourceType_WhenHandling_ThenSe
}

[Fact]
public async void GivenARequestWithAValidCodeAndResourceTypeThatDonotHaveMatchinSearchParameters_WhenHandling_ThenNoSearchParametersAreReturned()
public async Task GivenARequestWithAValidCodeAndResourceTypeThatDonotHaveMatchinSearchParameters_WhenHandling_ThenNoSearchParametersAreReturned()
{
// Arrange
var request = new SearchParameterStateRequest(new List<Tuple<string, string>>() { new Tuple<string, string>(SearchParameterStateProperties.Code, "lastUpdated"), new Tuple<string, string>(SearchParameterStateProperties.ResourceType, "nomatch") });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
using Microsoft.Health.Test.Utilities;
using NSubstitute;
using Xunit;
using Task = System.Threading.Tasks.Task;

namespace Microsoft.Health.Fhir.Shared.Core.UnitTests.Features.Operations.SearchParameterState
{
Expand Down Expand Up @@ -177,7 +178,7 @@ public SearchParameterStateUpdateHandlerTests()
}

[Fact]
public async void GivenARequestToUpdateSearchParameterStatus_WhenTheStatusIsEnabled_ThenTheStatusShouldBeUpdated()
public async Task GivenARequestToUpdateSearchParameterStatus_WhenTheStatusIsEnabled_ThenTheStatusShouldBeUpdated()
{
await _searchParameterDefinitionManager.EnsureInitializedAsync(CancellationToken.None);

Expand All @@ -200,7 +201,7 @@ public async void GivenARequestToUpdateSearchParameterStatus_WhenTheStatusIsEnab
}

[Fact]
public async void GivenARequestToUpdateSearchParameterStatus_WhenTheResourceIsNotFound_ThenAnOperationOutcomeIsReturnedWithInformationSeverity()
public async Task GivenARequestToUpdateSearchParameterStatus_WhenTheResourceIsNotFound_ThenAnOperationOutcomeIsReturnedWithInformationSeverity()
{
List<Tuple<Uri, SearchParameterStatus>> updates = new List<Tuple<Uri, SearchParameterStatus>>()
{
Expand All @@ -220,7 +221,7 @@ public async void GivenARequestToUpdateSearchParameterStatus_WhenTheResourceIsNo
}

[Fact]
public async void GivenARequestToUpdateSearchParameterStatus_WhenStatusIsNotSupportedOrDisabled_ThenAnOperationOutcomeIsReturnedWithErrorSeverity()
public async Task GivenARequestToUpdateSearchParameterStatus_WhenStatusIsNotSupportedOrDisabled_ThenAnOperationOutcomeIsReturnedWithErrorSeverity()
{
List<Tuple<Uri, SearchParameterStatus>> updates = new List<Tuple<Uri, SearchParameterStatus>>()
{
Expand All @@ -240,7 +241,7 @@ public async void GivenARequestToUpdateSearchParameterStatus_WhenStatusIsNotSupp
}

[Fact]
public async void GivenARequestToUpdateSearchParameterStatus_WhenStatusIsDisabled_ThenTheStatusIsUpdatedAsPendingDisable()
public async Task GivenARequestToUpdateSearchParameterStatus_WhenStatusIsDisabled_ThenTheStatusIsUpdatedAsPendingDisable()
{
await _searchParameterDefinitionManager.EnsureInitializedAsync(CancellationToken.None);

Expand All @@ -263,7 +264,7 @@ public async void GivenARequestToUpdateSearchParameterStatus_WhenStatusIsDisable
}

[Fact]
public async void GivenARequestToUpdateSearchParameterStatus_WhenRequestIsValied_ThenAuditLogContainsStateChange()
public async Task GivenARequestToUpdateSearchParameterStatus_WhenRequestIsValied_ThenAuditLogContainsStateChange()
{
await _searchParameterDefinitionManager.EnsureInitializedAsync(CancellationToken.None);

Expand Down
Loading
Loading