Upgrade test framework versions and fix test issues

This commit is contained in:
Nate McMaster 2017-05-15 14:11:27 -07:00
parent cd6befdef1
commit d70bfdd1ea
40 changed files with 76 additions and 139 deletions

View File

@ -10,8 +10,8 @@
<MoqVersion>4.7.1</MoqVersion>
<NETStandardImplicitPackageVersion>$(BundledNETStandardPackageVersion)</NETStandardImplicitPackageVersion>
<RoslynVersion>2.0.0</RoslynVersion>
<TestSdkVersion>15.0.0</TestSdkVersion>
<TestSdkVersion>15.3.0-*</TestSdkVersion>
<WebApiClientVersion>5.2.2</WebApiClientVersion>
<XunitVersion>2.2.0</XunitVersion>
<XunitVersion>2.3.0-beta2-*</XunitVersion>
</PropertyGroup>
</Project>

View File

@ -15,8 +15,4 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -13,8 +13,4 @@
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Builder
route.Constraints.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "area");
Assert.Equal("area", kvp.Key);
Assert.IsType<StringRouteConstraint>(kvp.Value);
});
Assert.Empty(route.DataTokens);
@ -41,8 +41,8 @@ namespace Microsoft.AspNetCore.Builder
route.Defaults.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "area");
Assert.Equal(kvp.Value, "admin");
Assert.Equal("area", kvp.Key);
Assert.Equal("admin", kvp.Value);
});
}
@ -68,7 +68,7 @@ namespace Microsoft.AspNetCore.Builder
route.Constraints.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "area");
Assert.Equal("area", kvp.Key);
Assert.IsType<StringRouteConstraint>(kvp.Value);
});
Assert.Empty(route.DataTokens);
@ -76,13 +76,13 @@ namespace Microsoft.AspNetCore.Builder
route.Defaults.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "action");
Assert.Equal(kvp.Value, "Home");
Assert.Equal("action", kvp.Key);
Assert.Equal("Home", kvp.Value);
},
kvp =>
{
Assert.Equal(kvp.Key, "area");
Assert.Equal(kvp.Value, "admin");
Assert.Equal("area", kvp.Key);
Assert.Equal("admin", kvp.Value);
});
}
@ -109,12 +109,12 @@ namespace Microsoft.AspNetCore.Builder
route.Constraints.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "area");
Assert.Equal("area", kvp.Key);
Assert.IsType<StringRouteConstraint>(kvp.Value);
},
kvp =>
{
Assert.Equal(kvp.Key, "id");
Assert.Equal("id", kvp.Key);
Assert.IsType<IntRouteConstraint>(kvp.Value);
});
Assert.Empty(route.DataTokens);
@ -122,13 +122,13 @@ namespace Microsoft.AspNetCore.Builder
route.Defaults.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "action");
Assert.Equal(kvp.Value, "Home");
Assert.Equal("action", kvp.Key);
Assert.Equal("Home", kvp.Value);
},
kvp =>
{
Assert.Equal(kvp.Key, "area");
Assert.Equal(kvp.Value, "admin");
Assert.Equal("area", kvp.Key);
Assert.Equal("admin", kvp.Value);
});
}
@ -156,32 +156,32 @@ namespace Microsoft.AspNetCore.Builder
route.Constraints.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "area");
Assert.Equal("area", kvp.Key);
Assert.IsType<StringRouteConstraint>(kvp.Value);
},
kvp =>
{
Assert.Equal(kvp.Key, "id");
Assert.Equal("id", kvp.Key);
Assert.IsType<IntRouteConstraint>(kvp.Value);
});
Assert.Collection(
route.DataTokens.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "some_token");
Assert.Equal(kvp.Value, "hello");
Assert.Equal("some_token", kvp.Key);
Assert.Equal("hello", kvp.Value);
});
Assert.Collection(
route.Defaults.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "action");
Assert.Equal(kvp.Value, "Home");
Assert.Equal("action", kvp.Key);
Assert.Equal("Home", kvp.Value);
},
kvp =>
{
Assert.Equal(kvp.Key, "area");
Assert.Equal(kvp.Value, "admin");
Assert.Equal("area", kvp.Key);
Assert.Equal("admin", kvp.Value);
});
}
@ -209,22 +209,22 @@ namespace Microsoft.AspNetCore.Builder
route.Constraints.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "area");
Assert.Equal("area", kvp.Key);
Assert.IsType<IntRouteConstraint>(kvp.Value);
});
Assert.Collection(
route.DataTokens.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "some_token");
Assert.Equal(kvp.Value, "hello");
Assert.Equal("some_token", kvp.Key);
Assert.Equal("hello", kvp.Value);
});
Assert.Collection(
route.Defaults.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "area");
Assert.Equal(kvp.Value, "Home");
Assert.Equal("area", kvp.Key);
Assert.Equal("Home", kvp.Value);
});
}
@ -247,7 +247,7 @@ namespace Microsoft.AspNetCore.Builder
route.Constraints.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "area");
Assert.Equal("area", kvp.Key);
Assert.IsType<StringRouteConstraint>(kvp.Value);
var values = new RouteValueDictionary(new { area = areaName });
@ -265,7 +265,7 @@ namespace Microsoft.AspNetCore.Builder
route.Defaults.OrderBy(kvp => kvp.Key),
kvp =>
{
Assert.Equal(kvp.Key, "area");
Assert.Equal("area", kvp.Key);
Assert.Equal(kvp.Value, areaName);
});
}

View File

@ -57,9 +57,9 @@ namespace Microsoft.AspNetCore.Mvc.Controllers
activator.Release(new ControllerContext(), controller);
// Assert
Assert.Equal(true, controller.Disposed);
Assert.True(controller.Disposed);
}
[Fact]
public void DefaultControllerActivator_ReleasesNonIDisposableController()
{

View File

@ -35,8 +35,8 @@ namespace Microsoft.AspNetCore.Mvc.Formatters
var result = await formatter.ReadAsync(context);
// Assert
Assert.Equal(true, result.HasError);
Assert.Equal(true, context.ModelState.ContainsKey("something"));
Assert.True(result.HasError);
Assert.True(context.ModelState.ContainsKey("something"));
Assert.Equal(1, context.ModelState["something"].Errors.Count);
var error = context.ModelState["something"].Errors[0];

View File

@ -392,6 +392,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
Assert.Empty(showPeople.Selectors[0].ActionConstraints.OfType<HttpMethodActionConstraint>());
}
[Fact]
public void AttributeRouting_TokenReplacement_IsAfterReflectedModel()
{
// Arrange

View File

@ -2448,6 +2448,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
() => invoker.InvokeAsync());
}
[Fact]
public async Task InvokeAction_AsyncAction_WithExceptionsAfterAwait()
{
// Arrange
@ -3549,7 +3550,6 @@ namespace Microsoft.AspNetCore.Mvc.Internal
public void OnAuthorization(AuthorizationFilterContext context)
{
Assert.NotNull(context.ModelState.MaxAllowedErrors);
Assert.Equal(_expectedMaxAllowedErrors, context.ModelState.MaxAllowedErrors);
}
}

View File

@ -846,15 +846,15 @@ namespace Microsoft.AspNetCore.Mvc.Internal
AssertKeysEqual(modelState, "items[0]", "items[1]", "items[2]");
var entry = modelState["items[0]"];
Assert.Equal(entry.ValidationState, ModelValidationState.Valid);
Assert.Equal(ModelValidationState.Valid, entry.ValidationState);
Assert.Empty(entry.Errors);
entry = modelState["items[1]"];
Assert.Equal(entry.ValidationState, ModelValidationState.Valid);
Assert.Equal(ModelValidationState.Valid, entry.ValidationState);
Assert.Empty(entry.Errors);
entry = modelState["items[2]"];
Assert.Equal(entry.ValidationState, ModelValidationState.Valid);
Assert.Equal(ModelValidationState.Valid, entry.ValidationState);
Assert.Empty(entry.Errors);
}

View File

@ -12,6 +12,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
{
public class FilterFactoryTest
{
[Fact]
public void GetAllFilters_ReturnsNoFilters_IfNoFiltersAreSpecified()
{
// Arrange

View File

@ -24,8 +24,4 @@
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -42,6 +42,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
Assert.Null(result);
}
[Fact]
public void GetBinder_WhenNoInputFormatters_Throws()
{
// Arrange

View File

@ -167,7 +167,6 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
var result = valueProvider.GetValue("prefix.name");
// Assert
Assert.NotNull(result);
Assert.Equal("someOtherValue", (string)result);
Assert.Equal(culture, result.Culture);
}
@ -183,7 +182,6 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
var result = valueProvider.GetValue("some");
// Assert
Assert.NotNull(result);
Assert.Equal(new[] { "someValue1", "someValue2" }, result.Values);
Assert.Equal("someValue1,someValue2", (string)result);
Assert.Equal(culture, result.Culture);

View File

@ -16,8 +16,4 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
kvp =>
{
Assert.Equal("data-val-equalto-other", kvp.Key);
Assert.Equal(kvp.Value, "*.OtherProperty");
Assert.Equal("*.OtherProperty", kvp.Value);
});
}
@ -91,7 +91,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
kvp =>
{
Assert.Equal("data-val-equalto-other", kvp.Key);
Assert.Equal(kvp.Value, "*.OtherProperty");
Assert.Equal("*.OtherProperty", kvp.Value);
});
}
@ -127,7 +127,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
kvp =>
{
Assert.Equal("data-val-equalto-other", kvp.Key);
Assert.Equal(kvp.Value, "*.OtherProperty");
Assert.Equal("*.OtherProperty", kvp.Value);
});
}
@ -164,7 +164,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
kvp =>
{
Assert.Equal("data-val-equalto-other", kvp.Key);
Assert.Equal(kvp.Value, "*.OtherProperty");
Assert.Equal("*.OtherProperty", kvp.Value);
});
}
@ -204,7 +204,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
kvp =>
{
Assert.Equal("data-val-equalto-other", kvp.Key);
Assert.Equal(kvp.Value, "*.OtherProperty");
Assert.Equal("*.OtherProperty", kvp.Value);
});
}

View File

@ -17,8 +17,4 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -17,8 +17,4 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -15,8 +15,4 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -87,7 +87,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
// Assert
var description = Assert.Single(result);
Assert.Equal(description.GroupName, "ApiExplorerNameSetByConvention");
Assert.Equal("ApiExplorerNameSetByConvention", description.GroupName);
}
[Fact]
@ -101,7 +101,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
// Assert
var description = Assert.Single(result);
Assert.Equal(description.GroupName, "SetOnController");
Assert.Equal("SetOnController", description.GroupName);
}
[Fact]
@ -115,7 +115,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
// Assert
var description = Assert.Single(result);
Assert.Equal(description.GroupName, "SetOnAction");
Assert.Equal("SetOnAction", description.GroupName);
}
[Fact]
@ -129,7 +129,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
// Assert
var description = Assert.Single(result);
Assert.Equal(description.RelativePath, "ApiExplorerRouteAndPathParametersInformation");
Assert.Equal("ApiExplorerRouteAndPathParametersInformation", description.RelativePath);
}
[Fact]
@ -143,7 +143,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
// Assert
var description = Assert.Single(result);
Assert.Equal(description.RelativePath, "ApiExplorerRouteAndPathParametersInformation/{id}");
Assert.Equal("ApiExplorerRouteAndPathParametersInformation/{id}", description.RelativePath);
var parameter = Assert.Single(description.ParameterDescriptions);
Assert.Equal("id", parameter.Name);

View File

@ -469,7 +469,7 @@ END:VCARD
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var body = await response.Content.ReadAsStringAsync();
Assert.Equal(body, "MethodWithFormatFilter");
Assert.Equal("MethodWithFormatFilter", body);
}
[Fact]

View File

@ -57,10 +57,6 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<!--
Work around https://github.com/NuGet/Home/issues/4412. MVC uses DependencyContext.Load() which looks next to a .dll
for a .deps.json. Information isn't available elsewhere. Need the .deps.json file for all web site applications.

View File

@ -861,7 +861,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
Assert.Equal("GetEmployees", result.Action);
Assert.Equal("/api/Company/5/Employees", result.ExpectedUrls.Single());
Assert.Equal(null, result.RouteName);
Assert.Null(result.RouteName);
}
[Fact]

View File

@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
// Model
var boundPerson = Assert.IsType<Person>(modelBindingResult.Model);
Assert.NotNull(boundPerson);
Assert.NotNull(boundPerson.Token);
Assert.NotSame(default(CancellationToken), boundPerson.Token);
// ModelState
Assert.True(modelState.IsValid);
@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
// Model
var boundPerson = Assert.IsType<Person>(modelBindingResult.Model);
Assert.NotNull(boundPerson);
Assert.NotNull(boundPerson.Token);
Assert.NotSame(default(CancellationToken), boundPerson.Token);
// ModelState
Assert.True(modelState.IsValid);
@ -120,7 +120,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
// Model
var token = Assert.IsType<CancellationToken>(modelBindingResult.Model);
Assert.NotNull(token);
Assert.NotSame(default(CancellationToken), token);
// ModelState
Assert.True(modelState.IsValid);

View File

@ -2677,7 +2677,6 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
// Model
var model = Assert.IsType<Photo>(modelBindingResult.Model);
Assert.Equal("1", model.Id);
Assert.NotNull(model.Info);
Assert.Equal("location1", model.Info.Key);
Assert.NotNull(model.Info.Value);
Assert.Equal("10,20", model.Info.Value.GpsCoordinates);

View File

@ -17,8 +17,4 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -396,6 +396,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
Assert.Null(error.Exception);
}
[Theory(Skip = "This test fails")]
[InlineData(typeof(int?))]
[InlineData(typeof(bool?))]
[InlineData(typeof(string))]
@ -551,4 +552,4 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
public int Zip { get; set; }
}
}
}
}

View File

@ -16,8 +16,4 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -26,8 +26,4 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -553,7 +553,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
await page.ExecuteAsync();
// Assert
Assert.Equal(false, actual);
Assert.False(actual);
}
[Fact]
@ -577,7 +577,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
await page.ExecuteAsync();
// Assert
Assert.Equal(true, actual);
Assert.True(actual);
}
[Fact]
@ -1610,4 +1610,4 @@ namespace Microsoft.AspNetCore.Mvc.Razor
}
}
}
}
}

View File

@ -300,7 +300,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.TagHelpers
// Assert
var attribute = Assert.Single(tagHelperOutput.Attributes);
Assert.Equal("href", attribute.Name, StringComparer.Ordinal);
Assert.Equal(true, attribute.Value);
Assert.True(Assert.IsType<bool>(attribute.Value));
Assert.Equal(HtmlAttributeValueStyle.DoubleQuotes, attribute.ValueStyle);
}

View File

@ -537,11 +537,11 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
Assert.Equal(message, ex.Message);
}
public void Post()
protected void Post()
{
}
public void PostAsync()
protected void PostAsync()
{
}
}

View File

@ -18,8 +18,4 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -20,8 +20,4 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -962,7 +962,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
tagHelperOutput.MergeAttributes(tagBuilder);
// Assert
Assert.Equal(tagHelperOutput.Attributes.Count, 2);
Assert.Equal(2, tagHelperOutput.Attributes.Count);
var attribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class"));
Assert.Equal(expectedOutputAttribute.Value, attribute.Value);
attribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("for"));

View File

@ -16,8 +16,4 @@
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -16,8 +16,4 @@
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -76,7 +76,7 @@ namespace Microsoft.AspNetCore.Mvc
// Assert
var keyValuePair = Assert.Single(attribute.RouteData);
Assert.Equal(keyValuePair.Key, "controller");
Assert.Equal("controller", keyValuePair.Key);
}
[Fact]
@ -87,7 +87,7 @@ namespace Microsoft.AspNetCore.Mvc
// Assert
var keyValuePair = Assert.Single(attribute.RouteData);
Assert.Equal(keyValuePair.Key, "action");
Assert.Equal("action", keyValuePair.Key);
Assert.Null(attribute.RouteName);
}

View File

@ -54,7 +54,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewComponents
factory.ReleaseViewComponent(context, component);
// Assert
Assert.Equal(true, component.Disposed);
Assert.True(component.Disposed);
}
}

View File

@ -376,7 +376,7 @@ namespace System.Net.Http.Formatting
}
[Theory]
[MemberData("MatchAcceptHeaderData")]
[MemberData(nameof(MatchAcceptHeaderData))]
public void MatchAcceptHeader_ReturnsMatch(string[] acceptHeaders, string[] supportedMediaTypes, string expectedMediaType, double expectedQuality, int ranking)
{
// Arrange
@ -409,7 +409,7 @@ namespace System.Net.Http.Formatting
}
[Theory]
[MemberData("MatchRequestMediaTypeData")]
[MemberData(nameof(MatchRequestMediaTypeData))]
public void MatchRequestMediaType_ReturnsMatch(string requestMediaType, string[] supportedMediaTypes, string expectedMediaType)
{
// Arrange
@ -443,7 +443,7 @@ namespace System.Net.Http.Formatting
}
[Theory]
[MemberData("ShouldMatchOnTypeData")]
[MemberData(nameof(ShouldMatchOnTypeData))]
public void ShouldMatchOnType_ReturnsExpectedResult(bool excludeMatchOnType, string[] acceptHeaders, bool expectedResult)
{
// Arrange
@ -459,7 +459,7 @@ namespace System.Net.Http.Formatting
}
[Theory]
[MemberData("MatchTypeData")]
[MemberData(nameof(MatchTypeData))]
public void MatchType_ReturnsMatch(string[] supportedMediaTypes, string expectedMediaType)
{
// Arrange
@ -482,7 +482,7 @@ namespace System.Net.Http.Formatting
}
[Theory]
[MemberData("SelectResponseMediaTypeData")]
[MemberData(nameof(SelectResponseMediaTypeData))]
public void SelectResponseMediaTypeFormatter_SelectsMediaType(ICollection<MediaTypeFormatterMatch> matches, MediaTypeFormatterMatch expectedWinner)
{
// Arrange
@ -496,7 +496,7 @@ namespace System.Net.Http.Formatting
}
[Theory]
[MemberData("SelectResponseCharacterEncodingData")]
[MemberData(nameof(SelectResponseCharacterEncodingData))]
public void SelectResponseCharacterEncoding_SelectsEncoding(string[] acceptCharsetHeaders, string requestEncoding, string[] supportedEncodings, string expectedEncoding)
{
// Arrange
@ -664,7 +664,7 @@ namespace System.Net.Http.Formatting
}
[Theory]
[MemberData("UpdateBestMatchData")]
[MemberData(nameof(UpdateBestMatchData))]
public void UpdateBestMatch_SelectsCorrectly(MediaTypeFormatterMatch current, MediaTypeFormatterMatch replacement, bool currentWins)
{
// Arrange

View File

@ -19,8 +19,4 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>