Skip to content

Commit

Permalink
Fixed all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
skoshelev committed Jul 9, 2018
1 parent 87bdef7 commit ee27f14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Tests/Nop.Services.Tests/TestDiscountService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Caching.Memory;
using Moq;
Expand All @@ -21,10 +20,11 @@ namespace Nop.Services.Tests
{
public class TestDiscountService : DiscountService
{
private List<DiscountForCaching> _discountForCaching;
private readonly List<DiscountForCaching> _discountForCaching;

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)
{
_discountForCaching = new List<DiscountForCaching>();
}

public override DiscountValidationResult ValidateDiscount(Discount discount, Customer customer)
Expand All @@ -44,7 +44,7 @@ public override IList<DiscountForCaching> 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();
}
Expand Down

0 comments on commit ee27f14

Please sign in to comment.