This commit is contained in:
Hao Kung 2014-05-07 13:03:55 -07:00
parent 6ca38a31c0
commit f36ca3fb33
6 changed files with 6 additions and 119 deletions

View File

@ -1,44 +0,0 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF
// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR
// NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing
// permissions and limitations under the License.
using System.Linq;
using Xunit;
namespace Microsoft.AspNet.Identity.Entity.Test
{
public static class IdentityResultAssert
{
public static void IsSuccess(IdentityResult result)
{
Assert.NotNull(result);
Assert.True(result.Succeeded);
}
public static void IsFailure(IdentityResult result)
{
Assert.NotNull(result);
Assert.False(result.Succeeded);
}
public static void IsFailure(IdentityResult result, string error)
{
Assert.NotNull(result);
Assert.False(result.Succeeded);
Assert.Equal(error, result.Errors.First());
}
}
}

View File

@ -17,6 +17,7 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity.Test;
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.InMemory;
using Microsoft.Framework.DependencyInjection;

View File

@ -16,6 +16,7 @@
//// permissions and limitations under the License.
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Identity.Test;
using Microsoft.AspNet.Testing;
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Metadata;
@ -83,7 +84,7 @@ namespace Microsoft.AspNet.Identity.Entity.Test
}
[Fact]
public async Task CanCreateUserUsingEF()
public void CanCreateUserUsingEF()
{
using (var db = CreateContext())
{

View File

@ -1,13 +1,11 @@
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Identity.Entity;
using Microsoft.AspNet.PipelineCore;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Identity.Test;
using Microsoft.Data.Entity;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.DependencyInjection.Fallback;
using System;
using System.Threading.Tasks;
using Microsoft.Data.Entity;
using Xunit;
using Microsoft.AspNet.Builder;
namespace Microsoft.AspNet.Identity.Entity.Test
{

View File

@ -1,44 +0,0 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF
// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR
// NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing
// permissions and limitations under the License.
using System.Linq;
using Xunit;
namespace Microsoft.AspNet.Identity.InMemory.Test
{
public static class IdentityResultAssert
{
public static void IsSuccess(IdentityResult result)
{
Assert.NotNull(result);
Assert.True(result.Succeeded);
}
public static void IsFailure(IdentityResult result)
{
Assert.NotNull(result);
Assert.False(result.Succeeded);
}
public static void IsFailure(IdentityResult result, string error)
{
Assert.NotNull(result);
Assert.False(result.Succeeded);
Assert.Equal(error, result.Errors.First());
}
}
}

View File

@ -1,25 +0,0 @@
// Copyright (c) Microsoft Open Technologies, Inc.
// All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF
// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR
// NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing
// permissions and limitations under the License.
namespace Microsoft.AspNet.Identity.Security.Test
{
public class TestUser
{
public string Id { get; private set; }
public string UserName { get; set; }
}
}