From 539d8c689d0ae01431271e78d48993a651457e2e Mon Sep 17 00:00:00 2001 From: Eric Fleming Date: Thu, 5 Dec 2019 19:23:55 -0700 Subject: [PATCH] Fixing login integration test (#332) * Removing unecessary test --- tests/IntegrationTests/LoginService.cs | 56 -------------------------- 1 file changed, 56 deletions(-) delete mode 100644 tests/IntegrationTests/LoginService.cs diff --git a/tests/IntegrationTests/LoginService.cs b/tests/IntegrationTests/LoginService.cs deleted file mode 100644 index b207f4f..0000000 --- a/tests/IntegrationTests/LoginService.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Xunit; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.eShopWeb.Infrastructure.Identity; -using System; -using Microsoft.AspNetCore.Identity; -using System.Threading.Tasks; - -namespace Microsoft.eShopWeb.IntegrationTests.Repositories.OrderRepositoryTests -{ - public class LoginService - { - [Fact] - public async Task LogsInSampleUser() - { - var services = new ServiceCollection() - .AddEntityFrameworkInMemoryDatabase(); - - services.AddDbContext(options => - { - options.UseInMemoryDatabase("Identity"); - }); - var serviceProvider = new ServiceCollection() - .BuildServiceProvider(); - - // Create a scope to obtain a reference to the database - // context (AppIdentityDbContext). - using (var scope = serviceProvider.CreateScope()) - { - var scopedServices = scope.ServiceProvider; - - try - { - // seed sample user data - var userManager = scopedServices.GetRequiredService>(); - - AppIdentityDbContextSeed.SeedAsync(userManager).Wait(); - - var signInManager = scopedServices.GetRequiredService>(); - - var email = "demouser@microsoft.com"; - var password = "Pass@word1"; - - var result = await signInManager.PasswordSignInAsync(email, password, false, lockoutOnFailure: false); - - Assert.True(result.Succeeded); - - } - catch (Exception) - { - } - } - - } - } -}