Skip to content

Commit b492d06

Browse files
committed
Fix warnings that are now occurring
1 parent bcaf2e8 commit b492d06

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/AspNetCore/OData/test/Asp.Versioning.OData.ApiExplorer.Tests/Conventions/ODataValidationSettingsConventionTest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ public void apply_to_should_process_odataX2Dlike_api_description()
621621

622622
model.SetAnnotationValue( model, new ApiVersionAnnotation( ApiVersion.Default ) );
623623

624+
#pragma warning disable CA1825 // Avoid zero-length array allocations
624625
return new()
625626
{
626627
ActionDescriptor = new ControllerActionDescriptor()
@@ -643,6 +644,7 @@ public void apply_to_should_process_odataX2Dlike_api_description()
643644
},
644645
Properties = { [typeof( ApiVersion )] = ApiVersion.Default },
645646
};
647+
#pragma warning restore CA1825 // Avoid zero-length array allocations
646648
}
647649

648650
private static ApiDescription NewApiDescription( Type controllerType ) =>
@@ -652,6 +654,7 @@ private static ApiDescription NewApiDescription( Type controllerType, Type respo
652654
{
653655
model.SetAnnotationValue( model, new ApiVersionAnnotation( ApiVersion.Default ) );
654656

657+
#pragma warning disable CA1825 // Avoid zero-length array allocations
655658
return new()
656659
{
657660
ActionDescriptor = new ControllerActionDescriptor()
@@ -674,6 +677,7 @@ private static ApiDescription NewApiDescription( Type controllerType, Type respo
674677
},
675678
Properties = { [typeof( ApiVersion )] = ApiVersion.Default },
676679
};
680+
#pragma warning restore CA1825 // Avoid zero-length array allocations
677681
}
678682

679683
#pragma warning disable IDE0060 // Remove unused parameter

src/AspNetCore/OData/test/Asp.Versioning.OData.Tests/Routing/DefaultMetadataMatcherPolicyTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ public void applies_to_endpoints_should_return_true_for_service_document()
1717
var paramSource = Mock.Of<IApiVersionParameterSource>();
1818
var options = Options.Create( new ApiVersioningOptions() );
1919
var policy = new DefaultMetadataMatcherPolicy( paramSource, options );
20+
#pragma warning disable CA1825 // Avoid zero-length array allocations
2021
var metadata = new ODataRoutingMetadata( string.Empty, EdmCoreModel.Instance, [] );
22+
#pragma warning restore CA1825 // Avoid zero-length array allocations
2123
var items = new object[] { metadata };
2224
var endpoints = new Endpoint[] { new( Limbo, new( items ), default ) };
2325

0 commit comments

Comments
 (0)