Skip to content

Commit cece3a1

Browse files
Simplify initialization
1 parent 791d8a4 commit cece3a1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/AspNet/WebApi/test/Asp.Versioning.WebApi.Tests/Controllers/HttpControllerDescriptorGroupTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ public void get_custom_attributes_should_aggregate_attributes()
5151
var configuration = new HttpConfiguration();
5252

5353
descriptor1.Setup( d => d.GetCustomAttributes<ApiVersionAttribute>( It.IsAny<bool>() ) )
54-
.Returns( () => new Collection<ApiVersionAttribute>() { new ApiVersionAttribute( "1.0" ) } );
54+
.Returns( () => new Collection<ApiVersionAttribute>() { new( "1.0" ) } );
5555
descriptor1.Object.Configuration = configuration;
5656
descriptor1.Object.Properties[typeof( ApiVersionModel )] = new ApiVersionModel( new ApiVersion( 1, 0 ) );
5757

5858
descriptor2.Setup( d => d.GetCustomAttributes<ApiVersionAttribute>( It.IsAny<bool>() ) )
59-
.Returns( () => new Collection<ApiVersionAttribute>() { new ApiVersionAttribute( "2.0" ) } );
59+
.Returns( () => new Collection<ApiVersionAttribute>() { new( "2.0" ) } );
6060
descriptor2.Object.Configuration = configuration;
6161
descriptor2.Object.Properties[typeof( ApiVersionModel )] = new ApiVersionModel( new ApiVersion( 2, 0 ) );
6262

src/AspNetCore/WebApi/test/Asp.Versioning.Mvc.Tests/ApplicationModels/DefaultApiControllerFilterTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public void apply_should_not_filter_list_without_specifications()
1717
var attributes = Array.Empty<object>();
1818
var controllers = new List<ControllerModel>()
1919
{
20-
new ControllerModel( controllerType, attributes ),
21-
new ControllerModel( controllerType, attributes ),
22-
new ControllerModel( controllerType, attributes ),
20+
new( controllerType, attributes ),
21+
new( controllerType, attributes ),
22+
new( controllerType, attributes ),
2323
};
2424

2525
// act
@@ -44,9 +44,9 @@ public void apply_should_filter_controllers()
4444
var attributes = Array.Empty<object>();
4545
var controllers = new List<ControllerModel>()
4646
{
47-
new ControllerModel( controllerType, attributes ),
48-
new ControllerModel( controllerBaseType, attributes ),
49-
new ControllerModel( controllerType, attributes ),
47+
new( controllerType, attributes ),
48+
new( controllerBaseType, attributes ),
49+
new( controllerType, attributes ),
5050
};
5151

5252
// act

0 commit comments

Comments
 (0)