Skip to content

Commit ee27f14

Browse files
committed
Fixed all tests
1 parent 87bdef7 commit ee27f14

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Tests/Nop.Services.Tests/TestDiscountService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using System.Linq;
43
using Microsoft.Extensions.Caching.Memory;
54
using Moq;
@@ -21,10 +20,11 @@ namespace Nop.Services.Tests
2120
{
2221
public class TestDiscountService : DiscountService
2322
{
24-
private List<DiscountForCaching> _discountForCaching;
23+
private readonly List<DiscountForCaching> _discountForCaching;
2524

2625
public TestDiscountService(ICategoryService categoryService, ICustomerService customerService, IEventPublisher eventPublisher, ILocalizationService localizationService, IPluginFinder pluginFinder, IRepository<Category> categoryRepository, IRepository<Discount> discountRepository, IRepository<DiscountRequirement> discountRequirementRepository, IRepository<DiscountUsageHistory> discountUsageHistoryRepository, IRepository<Manufacturer> manufacturerRepository, IRepository<Product> productRepository, IStaticCacheManager cacheManager, IStoreContext storeContext) : base(categoryService, customerService, eventPublisher, localizationService, pluginFinder, categoryRepository, discountRepository, discountRequirementRepository, discountUsageHistoryRepository, manufacturerRepository, productRepository, cacheManager, storeContext)
2726
{
27+
_discountForCaching = new List<DiscountForCaching>();
2828
}
2929

3030
public override DiscountValidationResult ValidateDiscount(Discount discount, Customer customer)
@@ -44,7 +44,7 @@ public override IList<DiscountForCaching> GetAllDiscountsForCaching(DiscountType
4444

4545
return _discountForCaching
4646
.Where(x=> !discountType.HasValue || x.DiscountType == discountType.Value)
47-
.Where(x => String.IsNullOrEmpty(couponCode) || x.CouponCode == couponCode)
47+
.Where(x => string.IsNullOrEmpty(couponCode) || x.CouponCode == couponCode)
4848
//UNDONE other filtering such as discountName, showHidden (not actually required in unit tests)
4949
.ToList();
5050
}

0 commit comments

Comments
 (0)