Ejemplo n.º 1
0
        public CampaignServiceTest()
        {
            var discount = new DiscountOption(DiscountType.Ratio, 25);
            var category = new Category("Food");

            defaultCampaign = new Campaign("Campaign 1", category, 1, discount);
        }
Ejemplo n.º 2
0
        public CouponManagerTest()
        {
            var discount = new DiscountOption(DiscountType.Ratio, 10);

            _coupon = new Coupon("X01", 500, discount);

            _couponService = new CouponService(_couponRepository);
            _couponService.Add(_coupon);
        }
Ejemplo n.º 3
0
        public InvoiceRecordDetail(PositiveInt lineNumber, Amount netValue, VatType vatType, Amount vatAmount, DiscountOption discountOption, IEnumerable <InvoiceRecordIncomeClassification> invoiceRecordIncomeClassification)
        {
            LineNumber     = lineNumber ?? throw new ArgumentNullException(nameof(lineNumber));
            NetValue       = netValue ?? throw new ArgumentNullException(nameof(netValue));
            VatType        = vatType;
            VatAmount      = vatAmount ?? throw new ArgumentNullException(nameof(vatAmount));
            DiscountOption = discountOption;
            InvoiceRecordIncomeClassification = invoiceRecordIncomeClassification ?? throw new ArgumentNullException(nameof(invoiceRecordIncomeClassification));

            if (invoiceRecordIncomeClassification.Count() == 0)
            {
                throw new ArgumentException($"Minimal count of {nameof(invoiceRecordIncomeClassification)} is 1.");
            }
        }
Ejemplo n.º 4
0
        public void WhenDefineDiscountOption_Successfully()
        {
            var discountOption = new DiscountOption(DiscountType.Amount, 50);

            Assert.NotNull(discountOption);
        }