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); }
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); }
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); }
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); }