Enable running tests xplat
This commit is contained in:
parent
9a2de0f49b
commit
a66f50c1ba
|
|
@ -11,7 +11,10 @@ addons:
|
||||||
- libunwind8
|
- libunwind8
|
||||||
- zlib1g
|
- zlib1g
|
||||||
env:
|
env:
|
||||||
- KOREBUILD_DNU_RESTORE_CORECLR=true
|
- KOREBUILD_DNU_RESTORE_CORECLR=true KOREBUILD_TEST_DNXCORE=true
|
||||||
|
os:
|
||||||
|
- linux
|
||||||
|
- osx
|
||||||
mono:
|
mono:
|
||||||
- 4.0.5
|
- 4.0.5
|
||||||
script:
|
script:
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[TestPriority(-1000)]
|
[TestPriority(-1000)]
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)][OSSkipCondition(OperatingSystems.Linux)][OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public void DropDatabaseStart()
|
public void DropDatabaseStart()
|
||||||
{
|
{
|
||||||
DropDb();
|
DropDb();
|
||||||
|
|
@ -54,7 +54,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[TestPriority(10000)]
|
[TestPriority(10000)]
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)][OSSkipCondition(OperatingSystems.Linux)][OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public void DropDatabaseDone()
|
public void DropDatabaseDone()
|
||||||
{
|
{
|
||||||
DropDb();
|
DropDb();
|
||||||
|
|
@ -67,7 +67,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)][OSSkipCondition(OperatingSystems.Linux)][OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task CanUpdateNameGuid()
|
public async Task CanUpdateNameGuid()
|
||||||
{
|
{
|
||||||
using (var db = CreateContext<Guid>(true))
|
using (var db = CreateContext<Guid>(true))
|
||||||
|
|
@ -85,7 +85,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)][OSSkipCondition(OperatingSystems.Linux)][OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task CanUpdateNameString()
|
public async Task CanUpdateNameString()
|
||||||
{
|
{
|
||||||
using (var db = CreateContext<string>(true))
|
using (var db = CreateContext<string>(true))
|
||||||
|
|
@ -103,7 +103,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)][OSSkipCondition(OperatingSystems.Linux)][OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task CanCreateUserInt()
|
public async Task CanCreateUserInt()
|
||||||
{
|
{
|
||||||
using (var db = CreateContext<int>(true))
|
using (var db = CreateContext<int>(true))
|
||||||
|
|
@ -119,7 +119,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)][OSSkipCondition(OperatingSystems.Linux)][OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task CanCreateUserIntViaSet()
|
public async Task CanCreateUserIntViaSet()
|
||||||
{
|
{
|
||||||
using (var db = CreateContext<int>(true))
|
using (var db = CreateContext<int>(true))
|
||||||
|
|
@ -136,7 +136,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)][OSSkipCondition(OperatingSystems.Linux)][OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task CanUpdateNameInt()
|
public async Task CanUpdateNameInt()
|
||||||
{
|
{
|
||||||
using (var db = CreateContext<int>(true))
|
using (var db = CreateContext<int>(true))
|
||||||
|
|
@ -154,7 +154,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)][OSSkipCondition(OperatingSystems.Linux)][OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task CanUpdateNameIntWithSet()
|
public async Task CanUpdateNameIntWithSet()
|
||||||
{
|
{
|
||||||
using (var db = CreateContext<int>(true))
|
using (var db = CreateContext<int>(true))
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
[TestPriority(-1000)]
|
[TestPriority(-1000)]
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public void DropDatabaseStart()
|
public void DropDatabaseStart()
|
||||||
{
|
{
|
||||||
DropDb();
|
DropDb();
|
||||||
|
|
@ -59,6 +61,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task EnsureStartupUsageWorks()
|
public async Task EnsureStartupUsageWorks()
|
||||||
{
|
{
|
||||||
var context = CreateContext(true);
|
var context = CreateContext(true);
|
||||||
|
|
@ -79,6 +83,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task CanIncludeUserClaimsTest()
|
public async Task CanIncludeUserClaimsTest()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
@ -107,6 +113,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task CanIncludeUserLoginsTest()
|
public async Task CanIncludeUserLoginsTest()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
@ -135,6 +143,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task CanIncludeUserRolesTest()
|
public async Task CanIncludeUserRolesTest()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
@ -177,6 +187,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task CanIncludeRoleClaimsTest()
|
public async Task CanIncludeRoleClaimsTest()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
@ -206,6 +218,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
[TestPriority(10000)]
|
[TestPriority(10000)]
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public void DropDatabaseDone()
|
public void DropDatabaseDone()
|
||||||
{
|
{
|
||||||
DropDb();
|
DropDb();
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ using System.Linq.Expressions;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Identity.Test;
|
using Microsoft.AspNet.Identity.Test;
|
||||||
|
using Microsoft.AspNet.Testing;
|
||||||
using Microsoft.AspNet.Testing.xunit;
|
using Microsoft.AspNet.Testing.xunit;
|
||||||
using Microsoft.Data.Entity;
|
using Microsoft.Data.Entity;
|
||||||
using Microsoft.Data.Entity.Storage;
|
using Microsoft.Data.Entity.Storage;
|
||||||
|
|
@ -23,6 +24,11 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
{
|
{
|
||||||
public abstract string ConnectionString { get; }
|
public abstract string ConnectionString { get; }
|
||||||
|
|
||||||
|
protected override bool ShouldSkipDbTests()
|
||||||
|
{
|
||||||
|
return TestPlatformHelper.IsMono || !TestPlatformHelper.IsWindows;
|
||||||
|
}
|
||||||
|
|
||||||
public class TestDbContext : IdentityDbContext<TUser, TRole, TKey> { }
|
public class TestDbContext : IdentityDbContext<TUser, TRole, TKey> { }
|
||||||
|
|
||||||
protected override TUser CreateTestUser(string namePrefix = "", string email = "", string phoneNumber = "",
|
protected override TUser CreateTestUser(string namePrefix = "", string email = "", string phoneNumber = "",
|
||||||
|
|
@ -56,6 +62,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
[TestPriority(-1000)]
|
[TestPriority(-1000)]
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public void DropDatabaseStart()
|
public void DropDatabaseStart()
|
||||||
{
|
{
|
||||||
DropDb();
|
DropDb();
|
||||||
|
|
@ -64,6 +72,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
[TestPriority(10000)]
|
[TestPriority(10000)]
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public void DropDatabaseDone()
|
public void DropDatabaseDone()
|
||||||
{
|
{
|
||||||
DropDb();
|
DropDb();
|
||||||
|
|
@ -113,6 +123,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public void EnsureDefaultSchema()
|
public void EnsureDefaultSchema()
|
||||||
{
|
{
|
||||||
VerifyDefaultSchema(CreateContext());
|
VerifyDefaultSchema(CreateContext());
|
||||||
|
|
@ -182,6 +194,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task DeleteRoleNonEmptySucceedsTest()
|
public async Task DeleteRoleNonEmptySucceedsTest()
|
||||||
{
|
{
|
||||||
// Need fail if not empty?
|
// Need fail if not empty?
|
||||||
|
|
@ -208,6 +222,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task DeleteUserRemovesFromRoleTest()
|
public async Task DeleteUserRemovesFromRoleTest()
|
||||||
{
|
{
|
||||||
// Need fail if not empty?
|
// Need fail if not empty?
|
||||||
|
|
@ -233,6 +249,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public void CanCreateUserUsingEF()
|
public void CanCreateUserUsingEF()
|
||||||
{
|
{
|
||||||
using (var db = CreateContext())
|
using (var db = CreateContext())
|
||||||
|
|
@ -247,6 +265,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task CanCreateUsingManager()
|
public async Task CanCreateUsingManager()
|
||||||
{
|
{
|
||||||
var manager = CreateManager();
|
var manager = CreateManager();
|
||||||
|
|
@ -281,6 +301,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task LoadFromDbFindByIdTest()
|
public async Task LoadFromDbFindByIdTest()
|
||||||
{
|
{
|
||||||
var db = CreateContext();
|
var db = CreateContext();
|
||||||
|
|
@ -298,6 +320,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task LoadFromDbFindByNameTest()
|
public async Task LoadFromDbFindByNameTest()
|
||||||
{
|
{
|
||||||
var db = CreateContext();
|
var db = CreateContext();
|
||||||
|
|
@ -314,6 +338,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task LoadFromDbFindByLoginTest()
|
public async Task LoadFromDbFindByLoginTest()
|
||||||
{
|
{
|
||||||
var db = CreateContext();
|
var db = CreateContext();
|
||||||
|
|
@ -330,6 +356,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
||||||
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
[OSSkipCondition(OperatingSystems.MacOSX)]
|
||||||
public async Task LoadFromDbFindByEmailTest()
|
public async Task LoadFromDbFindByEmailTest()
|
||||||
{
|
{
|
||||||
var db = CreateContext();
|
var db = CreateContext();
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Identity.Test;
|
using Microsoft.AspNet.Identity.Test;
|
||||||
|
using Microsoft.AspNet.Testing;
|
||||||
using Microsoft.AspNet.Testing.xunit;
|
using Microsoft.AspNet.Testing.xunit;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
@ -19,19 +20,30 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
|
|
||||||
private readonly string ConnectionString = @"Server=(localdb)\mssqllocaldb;Database=SqlUserStoreTest" + DateTime.Now.Month + "-" + DateTime.Now.Day + "-" + DateTime.Now.Year + ";Trusted_Connection=True;Connection Timeout=30";
|
private readonly string ConnectionString = @"Server=(localdb)\mssqllocaldb;Database=SqlUserStoreTest" + DateTime.Now.Month + "-" + DateTime.Now.Day + "-" + DateTime.Now.Year + ";Trusted_Connection=True;Connection Timeout=30";
|
||||||
|
|
||||||
|
protected override bool ShouldSkipDbTests()
|
||||||
|
{
|
||||||
|
return TestPlatformHelper.IsMono || !TestPlatformHelper.IsWindows;
|
||||||
|
}
|
||||||
|
|
||||||
[TestPriority(-1000)]
|
[TestPriority(-1000)]
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
|
||||||
public void DropDatabaseStart()
|
public void DropDatabaseStart()
|
||||||
{
|
{
|
||||||
|
if (ShouldSkipDbTests())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
DropDb();
|
DropDb();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestPriority(10000)]
|
[TestPriority(10000)]
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
|
||||||
public void DropDatabaseDone()
|
public void DropDatabaseDone()
|
||||||
{
|
{
|
||||||
|
if (ShouldSkipDbTests())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
DropDb();
|
DropDb();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -41,10 +53,13 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
db.Database.EnsureDeleted();
|
db.Database.EnsureDeleted();
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
|
||||||
public void CanCreateUserUsingEF()
|
public void CanCreateUserUsingEF()
|
||||||
{
|
{
|
||||||
|
if (ShouldSkipDbTests())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
using (var db = CreateContext())
|
using (var db = CreateContext())
|
||||||
{
|
{
|
||||||
var guid = Guid.NewGuid().ToString();
|
var guid = Guid.NewGuid().ToString();
|
||||||
|
|
@ -93,7 +108,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
services.AddSingleton<IRoleStore<IdentityRole>>(new RoleStore<IdentityRole, IdentityDbContext>((IdentityDbContext)context));
|
services.AddSingleton<IRoleStore<IdentityRole>>(new RoleStore<IdentityRole, IdentityDbContext>((IdentityDbContext)context));
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
public async Task SqlUserStoreMethodsThrowWhenDisposedTest()
|
public async Task SqlUserStoreMethodsThrowWhenDisposedTest()
|
||||||
{
|
{
|
||||||
var store = new UserStore(new IdentityDbContext());
|
var store = new UserStore(new IdentityDbContext());
|
||||||
|
|
@ -126,7 +141,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
async () => await store.GetPhoneNumberConfirmedAsync(null));
|
async () => await store.GetPhoneNumberConfirmedAsync(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
public async Task UserStorePublicNullCheckTest()
|
public async Task UserStorePublicNullCheckTest()
|
||||||
{
|
{
|
||||||
Assert.Throws<ArgumentNullException>("context", () => new UserStore(null));
|
Assert.Throws<ArgumentNullException>("context", () => new UserStore(null));
|
||||||
|
|
@ -192,10 +207,13 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
await Assert.ThrowsAsync<ArgumentException>("roleName", async () => await store.IsInRoleAsync(new IdentityUser("fake"), ""));
|
await Assert.ThrowsAsync<ArgumentException>("roleName", async () => await store.IsInRoleAsync(new IdentityUser("fake"), ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
|
||||||
public async Task CanCreateUsingManager()
|
public async Task CanCreateUsingManager()
|
||||||
{
|
{
|
||||||
|
if (ShouldSkipDbTests())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
var manager = CreateManager();
|
var manager = CreateManager();
|
||||||
var guid = Guid.NewGuid().ToString();
|
var guid = Guid.NewGuid().ToString();
|
||||||
var user = new IdentityUser { UserName = "New" + guid };
|
var user = new IdentityUser { UserName = "New" + guid };
|
||||||
|
|
@ -203,10 +221,13 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
IdentityResultAssert.IsSuccess(await manager.DeleteAsync(user));
|
IdentityResultAssert.IsSuccess(await manager.DeleteAsync(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
|
||||||
public async Task TwoUsersSamePasswordDifferentHash()
|
public async Task TwoUsersSamePasswordDifferentHash()
|
||||||
{
|
{
|
||||||
|
if (ShouldSkipDbTests())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
var manager = CreateManager();
|
var manager = CreateManager();
|
||||||
var userA = new IdentityUser(Guid.NewGuid().ToString());
|
var userA = new IdentityUser(Guid.NewGuid().ToString());
|
||||||
IdentityResultAssert.IsSuccess(await manager.CreateAsync(userA, "password"));
|
IdentityResultAssert.IsSuccess(await manager.CreateAsync(userA, "password"));
|
||||||
|
|
@ -216,10 +237,13 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
Assert.NotEqual(userA.PasswordHash, userB.PasswordHash);
|
Assert.NotEqual(userA.PasswordHash, userB.PasswordHash);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
|
||||||
public async Task AddUserToUnknownRoleFails()
|
public async Task AddUserToUnknownRoleFails()
|
||||||
{
|
{
|
||||||
|
if (ShouldSkipDbTests())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
var manager = CreateManager();
|
var manager = CreateManager();
|
||||||
var u = CreateTestUser();
|
var u = CreateTestUser();
|
||||||
IdentityResultAssert.IsSuccess(await manager.CreateAsync(u));
|
IdentityResultAssert.IsSuccess(await manager.CreateAsync(u));
|
||||||
|
|
@ -227,10 +251,13 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
async () => await manager.AddToRoleAsync(u, "bogus"));
|
async () => await manager.AddToRoleAsync(u, "bogus"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
|
||||||
public async Task ConcurrentUpdatesWillFail()
|
public async Task ConcurrentUpdatesWillFail()
|
||||||
{
|
{
|
||||||
|
if (ShouldSkipDbTests())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
var user = CreateTestUser();
|
var user = CreateTestUser();
|
||||||
using (var db = CreateContext())
|
using (var db = CreateContext())
|
||||||
{
|
{
|
||||||
|
|
@ -254,10 +281,13 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
|
||||||
public async Task ConcurrentUpdatesWillFailWithDetachedUser()
|
public async Task ConcurrentUpdatesWillFailWithDetachedUser()
|
||||||
{
|
{
|
||||||
|
if (ShouldSkipDbTests())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
var user = CreateTestUser();
|
var user = CreateTestUser();
|
||||||
using (var db = CreateContext())
|
using (var db = CreateContext())
|
||||||
{
|
{
|
||||||
|
|
@ -279,10 +309,13 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
|
||||||
public async Task DeleteAModifiedUserWillFail()
|
public async Task DeleteAModifiedUserWillFail()
|
||||||
{
|
{
|
||||||
|
if (ShouldSkipDbTests())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
var user = CreateTestUser();
|
var user = CreateTestUser();
|
||||||
using (var db = CreateContext())
|
using (var db = CreateContext())
|
||||||
{
|
{
|
||||||
|
|
@ -305,10 +338,13 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
|
||||||
public async Task ConcurrentRoleUpdatesWillFail()
|
public async Task ConcurrentRoleUpdatesWillFail()
|
||||||
{
|
{
|
||||||
|
if (ShouldSkipDbTests())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
var role = new IdentityRole(Guid.NewGuid().ToString());
|
var role = new IdentityRole(Guid.NewGuid().ToString());
|
||||||
using (var db = CreateContext())
|
using (var db = CreateContext())
|
||||||
{
|
{
|
||||||
|
|
@ -332,10 +368,13 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
|
||||||
public async Task ConcurrentRoleUpdatesWillFailWithDetachedRole()
|
public async Task ConcurrentRoleUpdatesWillFailWithDetachedRole()
|
||||||
{
|
{
|
||||||
|
if (ShouldSkipDbTests())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
var role = new IdentityRole(Guid.NewGuid().ToString());
|
var role = new IdentityRole(Guid.NewGuid().ToString());
|
||||||
using (var db = CreateContext())
|
using (var db = CreateContext())
|
||||||
{
|
{
|
||||||
|
|
@ -358,10 +397,13 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[Fact]
|
||||||
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
|
|
||||||
public async Task DeleteAModifiedRoleWillFail()
|
public async Task DeleteAModifiedRoleWillFail()
|
||||||
{
|
{
|
||||||
|
if (ShouldSkipDbTests())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
var role = new IdentityRole(Guid.NewGuid().ToString());
|
var role = new IdentityRole(Guid.NewGuid().ToString());
|
||||||
using (var db = CreateContext())
|
using (var db = CreateContext())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue