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> <MoqVersion>4.7.1</MoqVersion>
<NETStandardImplicitPackageVersion>$(BundledNETStandardPackageVersion)</NETStandardImplicitPackageVersion> <NETStandardImplicitPackageVersion>$(BundledNETStandardPackageVersion)</NETStandardImplicitPackageVersion>
<RoslynVersion>2.0.0</RoslynVersion> <RoslynVersion>2.0.0</RoslynVersion>
<TestSdkVersion>15.0.0</TestSdkVersion> <TestSdkVersion>15.3.0-*</TestSdkVersion>
<WebApiClientVersion>5.2.2</WebApiClientVersion> <WebApiClientVersion>5.2.2</WebApiClientVersion>
<XunitVersion>2.2.0</XunitVersion> <XunitVersion>2.3.0-beta2-*</XunitVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

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

View File

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

View File

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

View File

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

View File

@ -35,8 +35,8 @@ namespace Microsoft.AspNetCore.Mvc.Formatters
var result = await formatter.ReadAsync(context); var result = await formatter.ReadAsync(context);
// Assert // Assert
Assert.Equal(true, result.HasError); Assert.True(result.HasError);
Assert.Equal(true, context.ModelState.ContainsKey("something")); Assert.True(context.ModelState.ContainsKey("something"));
Assert.Equal(1, context.ModelState["something"].Errors.Count); Assert.Equal(1, context.ModelState["something"].Errors.Count);
var error = context.ModelState["something"].Errors[0]; 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>()); Assert.Empty(showPeople.Selectors[0].ActionConstraints.OfType<HttpMethodActionConstraint>());
} }
[Fact]
public void AttributeRouting_TokenReplacement_IsAfterReflectedModel() public void AttributeRouting_TokenReplacement_IsAfterReflectedModel()
{ {
// Arrange // Arrange

View File

@ -2448,6 +2448,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
() => invoker.InvokeAsync()); () => invoker.InvokeAsync());
} }
[Fact]
public async Task InvokeAction_AsyncAction_WithExceptionsAfterAwait() public async Task InvokeAction_AsyncAction_WithExceptionsAfterAwait()
{ {
// Arrange // Arrange
@ -3549,7 +3550,6 @@ namespace Microsoft.AspNetCore.Mvc.Internal
public void OnAuthorization(AuthorizationFilterContext context) public void OnAuthorization(AuthorizationFilterContext context)
{ {
Assert.NotNull(context.ModelState.MaxAllowedErrors);
Assert.Equal(_expectedMaxAllowedErrors, 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]"); AssertKeysEqual(modelState, "items[0]", "items[1]", "items[2]");
var entry = modelState["items[0]"]; var entry = modelState["items[0]"];
Assert.Equal(entry.ValidationState, ModelValidationState.Valid); Assert.Equal(ModelValidationState.Valid, entry.ValidationState);
Assert.Empty(entry.Errors); Assert.Empty(entry.Errors);
entry = modelState["items[1]"]; entry = modelState["items[1]"];
Assert.Equal(entry.ValidationState, ModelValidationState.Valid); Assert.Equal(ModelValidationState.Valid, entry.ValidationState);
Assert.Empty(entry.Errors); Assert.Empty(entry.Errors);
entry = modelState["items[2]"]; entry = modelState["items[2]"];
Assert.Equal(entry.ValidationState, ModelValidationState.Valid); Assert.Equal(ModelValidationState.Valid, entry.ValidationState);
Assert.Empty(entry.Errors); Assert.Empty(entry.Errors);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
kvp => kvp =>
{ {
Assert.Equal("data-val-equalto-other", kvp.Key); 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 => kvp =>
{ {
Assert.Equal("data-val-equalto-other", kvp.Key); 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 => kvp =>
{ {
Assert.Equal("data-val-equalto-other", kvp.Key); 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 => kvp =>
{ {
Assert.Equal("data-val-equalto-other", kvp.Key); 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 => kvp =>
{ {
Assert.Equal("data-val-equalto-other", kvp.Key); 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)" /> <PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project> </Project>

View File

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

View File

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

View File

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

View File

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

View File

@ -57,10 +57,6 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" /> <PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup> </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 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. 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("GetEmployees", result.Action);
Assert.Equal("/api/Company/5/Employees", result.ExpectedUrls.Single()); Assert.Equal("/api/Company/5/Employees", result.ExpectedUrls.Single());
Assert.Equal(null, result.RouteName); Assert.Null(result.RouteName);
} }
[Fact] [Fact]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -537,11 +537,11 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
Assert.Equal(message, ex.Message); 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)" /> <PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project> </Project>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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