Remove dependency on Microsoft.AspNetCore.Testing from test specifications
This commit is contained in:
parent
b1d1d85aee
commit
ba8675507c
|
|
@ -10,8 +10,6 @@ using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Testing;
|
|
||||||
using Microsoft.AspNetCore.Testing.xunit;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
@ -2344,11 +2342,13 @@ namespace Microsoft.AspNetCore.Identity.Test
|
||||||
var user = CreateTestUser();
|
var user = CreateTestUser();
|
||||||
IdentityResultAssert.IsSuccess(await manager.CreateAsync(user));
|
IdentityResultAssert.IsSuccess(await manager.CreateAsync(user));
|
||||||
const string error = "No IUserTokenProvider named 'bogus' is registered.";
|
const string error = "No IUserTokenProvider named 'bogus' is registered.";
|
||||||
await
|
var ex = await
|
||||||
ExceptionAssert.ThrowsAsync<NotSupportedException>(
|
Assert.ThrowsAsync<NotSupportedException>(
|
||||||
() => manager.GenerateTwoFactorTokenAsync(user, "bogus"), error);
|
() => manager.GenerateTwoFactorTokenAsync(user, "bogus"));
|
||||||
await ExceptionAssert.ThrowsAsync<NotSupportedException>(
|
Assert.Equal(error, ex.Message);
|
||||||
() => manager.VerifyTwoFactorTokenAsync(user, "bogus", "bogus"), error);
|
ex = await Assert.ThrowsAsync<NotSupportedException>(
|
||||||
|
() => manager.VerifyTwoFactorTokenAsync(user, "bogus", "bogus"));
|
||||||
|
Assert.Equal(error, ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -2597,8 +2597,7 @@ namespace Microsoft.AspNetCore.Identity.Test
|
||||||
/// Test.
|
/// Test.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Task</returns>
|
/// <returns>Task</returns>
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Fails due to threading bugs in Mono")]
|
|
||||||
public async Task CanGetUsersWithClaims()
|
public async Task CanGetUsersWithClaims()
|
||||||
{
|
{
|
||||||
if (ShouldSkipDbTests())
|
if (ShouldSkipDbTests())
|
||||||
|
|
@ -2627,8 +2626,7 @@ namespace Microsoft.AspNetCore.Identity.Test
|
||||||
/// Test.
|
/// Test.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Task</returns>
|
/// <returns>Task</returns>
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono, SkipReason = "Fails due to threading bugs in Mono")]
|
|
||||||
public async Task CanGetUsersInRole()
|
public async Task CanGetUsersInRole()
|
||||||
{
|
{
|
||||||
if (ShouldSkipDbTests())
|
if (ShouldSkipDbTests())
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(AspNetCoreVersion)" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(AspNetCoreVersion)" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(AspNetCoreVersion)" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(AspNetCoreVersion)" />
|
||||||
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
|
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue