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.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
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.csindex 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.csindex 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.csindex 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.csindex 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.csindex 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.csindex 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.Directorydiff --git a/src/Tests/Grand.Business.Common.Tests/Services/Directory/ExchangeRateServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Directory/ExchangeRateServiceTests.csindex 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.Directoryvar 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.Directoryvar 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.csindex 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.Directorydiff --git a/src/Tests/Grand.Business.Common.Tests/Services/Directory/MeasureServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Directory/MeasureServiceTests.csindex 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.csindex 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.Directorydiff --git a/src/Tests/Grand.Business.Common.Tests/Services/Security/AclServiceTest.cs b/src/Tests/Grand.Business.Common.Tests/Services/Security/AclServiceTest.csindex 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.csindex 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.Securityvar 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.csindex 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.Securitydiff --git a/src/Tests/Grand.Business.Common.Tests/Services/Stores/StoreServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Stores/StoreServiceTests.csindex 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