diff --git a/src/Tests/Nop.Services.Tests/TestDiscountService.cs b/src/Tests/Nop.Services.Tests/TestDiscountService.cs index 0883e85954b..1f5b5e8789b 100644 --- a/src/Tests/Nop.Services.Tests/TestDiscountService.cs +++ b/src/Tests/Nop.Services.Tests/TestDiscountService.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Caching.Memory; using Moq; @@ -21,10 +20,11 @@ namespace Nop.Services.Tests { public class TestDiscountService : DiscountService { - private List _discountForCaching; + private readonly List _discountForCaching; public TestDiscountService(ICategoryService categoryService, ICustomerService customerService, IEventPublisher eventPublisher, ILocalizationService localizationService, IPluginFinder pluginFinder, IRepository categoryRepository, IRepository discountRepository, IRepository discountRequirementRepository, IRepository discountUsageHistoryRepository, IRepository manufacturerRepository, IRepository productRepository, IStaticCacheManager cacheManager, IStoreContext storeContext) : base(categoryService, customerService, eventPublisher, localizationService, pluginFinder, categoryRepository, discountRepository, discountRequirementRepository, discountUsageHistoryRepository, manufacturerRepository, productRepository, cacheManager, storeContext) { + _discountForCaching = new List(); } public override DiscountValidationResult ValidateDiscount(Discount discount, Customer customer) @@ -44,7 +44,7 @@ public override IList GetAllDiscountsForCaching(DiscountType return _discountForCaching .Where(x=> !discountType.HasValue || x.DiscountType == discountType.Value) - .Where(x => String.IsNullOrEmpty(couponCode) || x.CouponCode == couponCode) + .Where(x => string.IsNullOrEmpty(couponCode) || x.CouponCode == couponCode) //UNDONE other filtering such as discountName, showHidden (not actually required in unit tests) .ToList(); }