Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Authentication tests - remove unused using

KrzysztofPajakcb2e5c1ea012
diff --git a/src/Tests/Grand.Business.Authentication.Tests/ApiAuthenticationServiceTests.cs b/src/Tests/Grand.Business.Authentication.Tests/ApiAuthenticationServiceTests.cs
index 6f227ec39..31b9f91de 100644
--- a/src/Tests/Grand.Business.Authentication.Tests/ApiAuthenticationServiceTests.cs
+++ b/src/Tests/Grand.Business.Authentication.Tests/ApiAuthenticationServiceTests.cs
@@ -4,15 +4,12 @@ using Grand.Business.Common.Interfaces.Directory;
using Grand.Business.Customers.Interfaces;
using Grand.Domain.Customers;
using Microsoft.AspNetCore.Authentication;
-using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Http;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
-using System;
using System.Collections.Generic;
using System.Security.Claims;
-using System.Text;
using System.Threading.Tasks;
namespace Grand.Business.Authentication.Tests
diff --git a/src/Tests/Grand.Business.Authentication.Tests/AuthSchemaMock.cs b/src/Tests/Grand.Business.Authentication.Tests/AuthSchemaMock.cs
index 8b79c9cba..339f2531d 100644
--- a/src/Tests/Grand.Business.Authentication.Tests/AuthSchemaMock.cs
+++ b/src/Tests/Grand.Business.Authentication.Tests/AuthSchemaMock.cs
@@ -1,8 +1,6 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Threading.Tasks;
namespace Grand.Business.Authentication.Tests
diff --git a/src/Tests/Grand.Business.Authentication.Tests/CookieAuthenticationServiceTests.cs b/src/Tests/Grand.Business.Authentication.Tests/CookieAuthenticationServiceTests.cs
index 1a0675206..dcb8e1656 100644
--- a/src/Tests/Grand.Business.Authentication.Tests/CookieAuthenticationServiceTests.cs
+++ b/src/Tests/Grand.Business.Authentication.Tests/CookieAuthenticationServiceTests.cs
@@ -10,9 +10,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
using System.Collections.Generic;
-using System.Linq;
using System.Security.Claims;
-using System.Text;
using System.Threading.Tasks;
namespace Grand.Business.Authentication.Tests
@@ -35,7 +33,7 @@ namespace Grand.Business.Authentication.Tests
public void Init()
{
_customerServiceMock = new Mock<ICustomerService>();
-
+
_httpAccessorMock = new Mock<IHttpContextAccessor>();
_customerSettings = new CustomerSettings();
_groupServiceMock = new Mock<IGroupService>();
@@ -43,7 +41,7 @@ namespace Grand.Business.Authentication.Tests
_config = new AppConfig();
_config.CookieClaimsIssuer = "grandnode";
_config.CookiePrefix = ".Grand.";
- _cookieAuthService = new CookieAuthenticationService(_customerSettings, _customerServiceMock.Object, _groupServiceMock.Object,_userFieldServiceMock.Object, _httpAccessorMock.Object, _config);
+ _cookieAuthService = new CookieAuthenticationService(_customerSettings, _customerServiceMock.Object, _groupServiceMock.Object, _userFieldServiceMock.Object, _httpAccessorMock.Object, _config);
//For mock HttpContext extension methods like SignOutAsync ,SignInAsync etc..
_authServiceMock = new Mock<IAuthenticationService>();
serviceProviderMock = new Mock<IServiceProvider>();
@@ -94,7 +92,7 @@ namespace Grand.Business.Authentication.Tests
public async Task GetAuthenticatedCustomer_UsernameEnableRegisterd_ReturnCustomer()
{
var expectedCustomer = new Customer() { Username = "John", Active = true };
-
+
_customerSettings.UsernamesEnabled = true;
var cliaim = new Claim(ClaimTypes.Name, "Johny", "", "grandnode");
IList<Claim> claims = new List<Claim>