public static IDiscountService GetInstance() { if (discountService == null) { discountService = new DiscountService(); } return discountService; }
public void Setup() { couponList = new List<UserDiscount>(); discountService = (DiscountService)DiscountService.GetInstance(); userDiscount = User_DiscountTest.CreateCoupon(); couponList.Add(coupon); isSuccess = false; error = null; discountService.couponUtility = mockUserDiscountUtility.Object; discountService.dbContext = mockContext.Object; }