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.

Common tests - remove unused using

KrzysztofPajak4d526cf4438d
diff --git a/src/Tests/Grand.Business.Common.Tests/Extensions/AddressAttributeExtensionsTests.cs b/src/Tests/Grand.Business.Common.Tests/Extensions/AddressAttributeExtensionsTests.cs
index a883ed3eb..3f26fc704 100644
--- a/src/Tests/Grand.Business.Common.Tests/Extensions/AddressAttributeExtensionsTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Extensions/AddressAttributeExtensionsTests.cs
@@ -2,11 +2,6 @@
using Grand.Domain.Catalog;
using Grand.Domain.Common;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Extensions
{
diff --git a/src/Tests/Grand.Business.Common.Tests/Extensions/SeoExtensionsTests.cs b/src/Tests/Grand.Business.Common.Tests/Extensions/SeoExtensionsTests.cs
index 202d8c292..58194777f 100644
--- a/src/Tests/Grand.Business.Common.Tests/Extensions/SeoExtensionsTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Extensions/SeoExtensionsTests.cs
@@ -1,11 +1,6 @@
using Grand.Business.Common.Extensions;
using Grand.Domain.Catalog;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Extensions
{
diff --git a/src/Tests/Grand.Business.Common.Tests/Extensions/TranslateExtensionsTests.cs b/src/Tests/Grand.Business.Common.Tests/Extensions/TranslateExtensionsTests.cs
index 9a0f5950f..97e30b6d3 100644
--- a/src/Tests/Grand.Business.Common.Tests/Extensions/TranslateExtensionsTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Extensions/TranslateExtensionsTests.cs
@@ -5,10 +5,7 @@ using Grand.Domain.Permissions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
-using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Extensions
{
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Addresses/AddressAttributeParserTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Addresses/AddressAttributeParserTests.cs
index 0a73341d6..3c714181e 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Addresses/AddressAttributeParserTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Addresses/AddressAttributeParserTests.cs
@@ -4,10 +4,8 @@ using Grand.Business.Common.Services.Addresses;
using Grand.Domain.Common;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
-using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Services.Addresses
@@ -25,7 +23,7 @@ namespace Grand.Business.Common.Tests.Services.Addresses
{
_atrService = new Mock<IAddressAttributeService>();
_translationService = new Mock<ITranslationService>();
- _parser = new AddressAttributeParser(_atrService.Object,_translationService.Object);
+ _parser = new AddressAttributeParser(_atrService.Object, _translationService.Object);
customAtr = new List<CustomAttribute>()
{
new CustomAttribute(){Key="key1",Value="value1" },
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Configuration/SettingServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Configuration/SettingServiceTests.cs
index 6d5006dc7..21124f6bd 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Configuration/SettingServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Configuration/SettingServiceTests.cs
@@ -5,9 +5,6 @@ using Grand.Infrastructure.Caching;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Services.Configuration
@@ -24,7 +21,7 @@ namespace Grand.Business.Common.Tests.Services.Configuration
{
_cacheMock = new Mock<ICacheBase>();
_repositoryMock = new Mock<IRepository<Setting>>();
- _service = new SettingService(_cacheMock.Object, _repositoryMock.Object) ;
+ _service = new SettingService(_cacheMock.Object, _repositoryMock.Object);
}
[TestMethod()]
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Directory/CurrencyServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Directory/CurrencyServiceTests.cs
index 105435223..03a225096 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Directory/CurrencyServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Directory/CurrencyServiceTests.cs
@@ -12,7 +12,6 @@ using MediatR;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
-using System.Linq;
using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Services.Directory
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Directory/ExchangeRateServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Directory/ExchangeRateServiceTests.cs
index 4a7c2e563..f96ab42f9 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Directory/ExchangeRateServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Directory/ExchangeRateServiceTests.cs
@@ -3,10 +3,7 @@ using Grand.Business.Common.Services.Directory;
using Grand.Domain.Directory;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
-using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Services.Directory
@@ -28,7 +25,7 @@ namespace Grand.Business.Common.Tests.Services.Directory
var provider = new Mock<IExchangeRateProvider>();
provider.Setup(c => c.SystemName).Returns("sysname");
_settings.ActiveExchangeRateProviderSystemName = "sysname";
- var exchangeRateService = new ExchangeRateService(new List<IExchangeRateProvider>() { provider.Object},_settings);
+ var exchangeRateService = new ExchangeRateService(new List<IExchangeRateProvider>() { provider.Object }, _settings);
await exchangeRateService.GetCurrencyLiveRates("rate");
provider.Verify(c => c.GetCurrencyLiveRates(It.IsAny<string>()), Times.Once);
}
@@ -39,7 +36,7 @@ namespace Grand.Business.Common.Tests.Services.Directory
var provider = new Mock<IExchangeRateProvider>();
provider.Setup(c => c.SystemName).Returns("sysname");
var exchangeRateService = new ExchangeRateService(new List<IExchangeRateProvider>() { provider.Object }, _settings);
- var result =exchangeRateService.LoadExchangeRateProviderBySystemName("sysname");
+ var result = exchangeRateService.LoadExchangeRateProviderBySystemName("sysname");
Assert.IsNotNull(result);
Assert.AreEqual(result.SystemName, "sysname");
}
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Directory/HistoryServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Directory/HistoryServiceTests.cs
index 917e66965..87d148c0d 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Directory/HistoryServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Directory/HistoryServiceTests.cs
@@ -6,9 +6,6 @@ using Grand.Domain.History;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Services.Directory
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Directory/MeasureServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Directory/MeasureServiceTests.cs
index 325060184..4c78e80c8 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Directory/MeasureServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Directory/MeasureServiceTests.cs
@@ -6,10 +6,6 @@ using Grand.Infrastructure.Events;
using MediatR;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Services.Directory
@@ -34,8 +30,8 @@ namespace Grand.Business.Common.Tests.Services.Directory
_muRepositoryMock = new Mock<IRepository<MeasureUnit>>();
_settings = new MeasureSettings();
_mediatorMock = new Mock<IMediator>();
- _measureService = new MeasureService(_cacheMock.Object,_mdRepositoryMock.Object,_mwRepositoryMock.Object,
- _muRepositoryMock.Object,_settings,_mediatorMock.Object);
+ _measureService = new MeasureService(_cacheMock.Object, _mdRepositoryMock.Object, _mwRepositoryMock.Object,
+ _muRepositoryMock.Object, _settings, _mediatorMock.Object);
}
[TestMethod()]
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Directory/SearchTermServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Directory/SearchTermServiceTests.cs
index 4d9508bb9..77fb6762c 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Directory/SearchTermServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Directory/SearchTermServiceTests.cs
@@ -6,9 +6,6 @@ using MediatR;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Services.Directory
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Security/AclServiceTest.cs b/src/Tests/Grand.Business.Common.Tests/Services/Security/AclServiceTest.cs
index 07ba6de52..b2dd1c654 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Security/AclServiceTest.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Security/AclServiceTest.cs
@@ -2,11 +2,6 @@
using Grand.Domain.Catalog;
using Grand.SharedKernel.Extensions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Services.Security
{
@@ -36,7 +31,7 @@ namespace Grand.Business.Common.Tests.Services.Security
[TestMethod]
public void Authorize_ReturnTrue()
{
- Product product = new Product();
+ Product product = new Product();
product.LimitedToStores = false;
Assert.IsTrue(_aclService.Authorize(product, "id"));
Assert.IsTrue(_aclService.Authorize(product, ""));
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Security/EncryptionServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Security/EncryptionServiceTests.cs
index 29c8f2de6..843b1e59a 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Security/EncryptionServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Security/EncryptionServiceTests.cs
@@ -1,10 +1,6 @@
using Grand.Business.Common.Services.Security;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Services.Security
{
@@ -37,9 +33,9 @@ namespace Grand.Business.Common.Tests.Services.Security
var salt = _encryptionService.CreateSaltKey(32);
var hash1 = _encryptionService.CreatePasswordHash(password, salt);
var hash2 = _encryptionService.CreatePasswordHash(password, salt);
- var hash3 = _encryptionService.CreatePasswordHash(password, salt,Domain.Customers.HashedPasswordFormat.SHA384);
- var hash4 = _encryptionService.CreatePasswordHash(password, salt,Domain.Customers.HashedPasswordFormat.SHA384);
- var hash5 = _encryptionService.CreatePasswordHash(password, salt,Domain.Customers.HashedPasswordFormat.SHA512);
+ var hash3 = _encryptionService.CreatePasswordHash(password, salt, Domain.Customers.HashedPasswordFormat.SHA384);
+ var hash4 = _encryptionService.CreatePasswordHash(password, salt, Domain.Customers.HashedPasswordFormat.SHA384);
+ var hash5 = _encryptionService.CreatePasswordHash(password, salt, Domain.Customers.HashedPasswordFormat.SHA512);
Assert.AreEqual(hash1, hash2);
Assert.AreEqual(hash3, hash4);
Assert.AreNotEqual(hash4, hash5);
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Security/PermissionServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Security/PermissionServiceTests.cs
index 39a864017..acd9331a6 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Security/PermissionServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Security/PermissionServiceTests.cs
@@ -9,8 +9,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Services.Security
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Stores/StoreServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Stores/StoreServiceTests.cs
index d6d8955cb..7a4ad46ca 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Stores/StoreServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Stores/StoreServiceTests.cs
@@ -8,8 +8,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading.Tasks;
namespace Grand.Business.Common.Tests.Services.Stores