Fix bad merges

This commit is contained in:
Hao Kung 2014-06-23 15:11:07 -07:00
parent 84e140e63c
commit a45d4fd338
4 changed files with 46 additions and 48 deletions

View File

@ -1,10 +1,10 @@
{ {
"version": "0.1-alpha-*", "version": "3.0.0-*",
"dependencies": { "dependencies": {
"Microsoft.Framework.ConfigurationModel": "0.1-alpha-*", "Microsoft.Framework.ConfigurationModel": "1.0.0-*",
"Microsoft.Framework.DependencyInjection" : "0.1-alpha-*", "Microsoft.Framework.DependencyInjection" : "1.0.0-*",
"Microsoft.Framework.OptionsModel": "0.1-alpha-*", "Microsoft.Framework.OptionsModel": "1.0.0-*",
"System.Security.Claims" : "0.1-alpha-*" "System.Security.Claims" : "1.0.0-*"
}, },
"configurations": { "configurations": {
"net45": {}, "net45": {},

View File

@ -23,51 +23,51 @@ namespace Microsoft.AspNet.Identity.Authentication.Test
public class HttpSignInTest public class HttpSignInTest
{ {
#if NET45 #if NET45
[Theory] //[Theory]
[InlineData(true)] //[InlineData(true)]
[InlineData(false)] //[InlineData(false)]
public async Task VerifyAccountControllerSignIn(bool isPersistent) //public async Task VerifyAccountControllerSignIn(bool isPersistent)
{ //{
IBuilder app = new Builder.Builder(new ServiceCollection().BuildServiceProvider()); // IBuilder app = new Builder.Builder(new ServiceCollection().BuildServiceProvider());
app.UseCookieAuthentication(new CookieAuthenticationOptions // app.UseCookieAuthentication(new CookieAuthenticationOptions
{ // {
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie // AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie
}); // });
var context = new Mock<HttpContext>(); // var context = new Mock<HttpContext>();
var response = new Mock<HttpResponse>(); // var response = new Mock<HttpResponse>();
context.Setup(c => c.Response).Returns(response.Object).Verifiable(); // context.Setup(c => c.Response).Returns(response.Object).Verifiable();
response.Setup(r => r.SignIn(It.IsAny<ClaimsIdentity>(), It.Is<AuthenticationProperties>(v => v.IsPersistent == isPersistent))).Verifiable(); // response.Setup(r => r.SignIn(It.IsAny<ClaimsIdentity>(), It.Is<AuthenticationProperties>(v => v.IsPersistent == isPersistent))).Verifiable();
var contextAccessor = new Mock<IContextAccessor<HttpContext>>(); // var contextAccessor = new Mock<IContextAccessor<HttpContext>>();
contextAccessor.Setup(a => a.Value).Returns(context.Object); // contextAccessor.Setup(a => a.Value).Returns(context.Object);
app.UseServices(services => // app.UseServices(services =>
{ // {
services.Add(OptionsServices.GetDefaultServices()); // services.Add(OptionsServices.GetDefaultServices());
services.AddInstance(contextAccessor.Object); // services.AddInstance(contextAccessor.Object);
services.AddIdentity<ApplicationUser, IdentityRole>(s => // services.AddIdentity<ApplicationUser, IdentityRole>(s =>
{ // {
s.AddInMemory(); // s.AddInMemory();
}).AddHttpSignIn<ApplicationUser>(); // }).AddHttpSignIn<ApplicationUser>();
}); // });
// Act // // Act
var user = new ApplicationUser // var user = new ApplicationUser
{ // {
UserName = "Yolo" // UserName = "Yolo"
}; // };
const string password = "Yol0Sw@g!"; // const string password = "Yol0Sw@g!";
var userManager = app.ApplicationServices.GetService<UserManager<ApplicationUser>>(); // var userManager = app.ApplicationServices.GetService<UserManager<ApplicationUser>>();
var signInManager = app.ApplicationServices.GetService<SignInManager<ApplicationUser>>(); // var signInManager = app.ApplicationServices.GetService<SignInManager<ApplicationUser>>();
IdentityResultAssert.IsSuccess(await userManager.CreateAsync(user, password)); // IdentityResultAssert.IsSuccess(await userManager.CreateAsync(user, password));
var result = await signInManager.PasswordSignInAsync(user.UserName, password, isPersistent, false); // var result = await signInManager.PasswordSignInAsync(user.UserName, password, isPersistent, false);
// Assert // // Assert
Assert.Equal(SignInStatus.Success, result); // Assert.Equal(SignInStatus.Success, result);
context.VerifyAll(); // context.VerifyAll();
response.VerifyAll(); // response.VerifyAll();
contextAccessor.VerifyAll(); // contextAccessor.VerifyAll();
} //}
//[Theory] //[Theory]
//[InlineData(true)] //[InlineData(true)]

View File

@ -4,7 +4,6 @@
"Microsoft.AspNet.Http" : "1.0.0-*", "Microsoft.AspNet.Http" : "1.0.0-*",
"Microsoft.AspNet.HttpFeature" : "1.0.0-*", "Microsoft.AspNet.HttpFeature" : "1.0.0-*",
"Microsoft.AspNet.Identity" : "", "Microsoft.AspNet.Identity" : "",
"Microsoft.AspNet.Identity.InMemory" : "",
"Microsoft.AspNet.Identity.Authentication" : "", "Microsoft.AspNet.Identity.Authentication" : "",
"Microsoft.AspNet.PipelineCore" : "1.0.0-*", "Microsoft.AspNet.PipelineCore" : "1.0.0-*",
"Microsoft.AspNet.RequestContainer" : "1.0.0-*", "Microsoft.AspNet.RequestContainer" : "1.0.0-*",

View File

@ -1,5 +1,4 @@
{ {
"version": "0.1-alpha-*",
"dependencies": { "dependencies": {
"Microsoft.AspNet.Http": "1.0.0-*", "Microsoft.AspNet.Http": "1.0.0-*",
"Microsoft.AspNet.Identity": "", "Microsoft.AspNet.Identity": "",