예제 #1
0
        public SoldArticle3(Warranty moneyBack, Warranty express, IWarrantyRulesFactory rulesFactory)
        {
            _moneyBackGuarantee     = moneyBack ?? throw new ArgumentNullException();
            _notOperationalWarranty = express ?? throw new ArgumentNullException();
            _circuitWarranty        = VoidWarranty.Instance;

            WarrantyRules = rulesFactory.Create(ClaimMoneyBack, ClaimNotOperational, ClaimCircuitry);
        }
예제 #2
0
        public SoldArticle(IWarranty moneyBackGuarantee,
                           IWarranty expressWarranty,
                           IWarrantyRulesFactory rulesFactory)
        {
            MoneyBackGuarantee     = moneyBackGuarantee ?? throw new ArgumentNullException(nameof(moneyBackGuarantee));
            NotOperationalWarranty = expressWarranty ?? throw new ArgumentNullException(nameof(expressWarranty));
            CircuitryWarranty      = VoidWarranty.Instance;

            WarrantyRules = rulesFactory
                            .Create(ClaimMoneyBack, ClaimNotOperationalWarranty, ClaimCircuitryWarranty);
        }
예제 #3
0
        public SoldArticle(IWarranty moneyBack, IWarranty express, IWarrantyRulesFactory rulesFactory)
        {
            if (moneyBack == null)
            {
                throw new ArgumentNullException(nameof(moneyBack));
            }
            if (express == null)
            {
                throw new ArgumentNullException(nameof(express));
            }

            this.MoneyBackGuarantee     = moneyBack;
            this.NotOperationalWarranty = express;
            this.CircuitryWarranty      = VoidWarranty.Instance;

            this.WarrantyRules = rulesFactory.Create(
                this.ClaimMoneyBack, this.ClaimNotOperationalWarranty, this.ClaimCircuitryWarranty);
        }
예제 #4
0
파일: SoldArticle.cs 프로젝트: john4ani/OOP
        public SoldArticle(IWarranty moneyBackGuatrantee, IWarranty expressWarranty,
                           IWarrantyRulesFactory factory)
        {
            if (moneyBackGuatrantee == null)
            {
                throw new ArgumentNullException(nameof(moneyBackGuatrantee));
            }
            if (expressWarranty == null)
            {
                throw new ArgumentNullException(nameof(expressWarranty));
            }

            MoneyBackGuatrantee    = moneyBackGuatrantee;
            NotOperationalWarranty = expressWarranty;
            CircutryWarranty       = VoidWarranty.Instance;

            //IsOperational = true;
            WarrantyRules = factory.Create(
                ClaimMoneyBack, ClaimNotOperationalWarranty, ClaimCircuitryWarranty);
        }