Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public MoneyBackRule(Action <Action> claimAction, IWarrantyRules next)
     : base(next)
 {
     Claim       = Forward;
     ClaimAction = claimAction;
 }
 public NotOperationalRule(Action <Action> claimAction, IWarrantyRules next)
     : base(next)
 {
     ClaimAction = claimAction;
     Claim       = Forward;
 }
Ejemplo n.º 7
0
 public MoneyBackRule(Action <Action> claimAction, IWarrantyRules next) : base(next)
 {
     this.Claim = claimAction;
 }
Ejemplo n.º 8
0
 public ConditionalRule(Func <bool> predicate, Action <Action> claimAction, IWarrantyRules next)
 {
     this.Predicate   = predicate;
     this.ClaimAction = claimAction;
     this.Next        = next;
 }
Ejemplo n.º 9
0
 public ChainedRule(IWarrantyRules next)
 {
     this.Next = next;
 }
Ejemplo n.º 10
0
 public CircuitryRule(Action <Action> claimAction, IWarrantyRules next)
     : base(next)
 {
     base.Claim       = base.Forward;
     this.ClaimAction = claimAction;
 }
Ejemplo n.º 11
0
 public CircuitryRule(Action <Action> claimAction, IWarrantyRules next)
     : base(next)
 {
     Claim       = Forward;
     ClaimAction = claimAction;
 }
Ejemplo n.º 12
0
 protected ChainedRule(IWarrantyRules next)
 {
     _next = next;
     Claim = Forward;
 }
Ejemplo n.º 13
0
 public CircuitryRule(Action <Action> claimAction, IWarrantyRules next) : base(next)
 {
     _claimAction = claimAction;
 }
Ejemplo n.º 14
0
 public NotOperationalRule(Action <Action> claimAction, IWarrantyRules next) : base(next)
 {
     base.Claim       = base.Forward;
     this.ClaimAction = claimAction;
 }
Ejemplo n.º 15
0
 protected ChainedRule(IWarrantyRules next)
 {
     Next = next;
 }
Ejemplo n.º 16
0
 public ConditionalRule(Func <bool> predicate, Action <Action> claimAction, IWarrantyRules next)
 {
     _predicate   = predicate;
     _claimAction = claimAction;
     _next        = next;
 }
Ejemplo n.º 17
0
 public NotOperationalRule(Action <Action> claimAction, IWarrantyRules next) : base(next)
 {
     _claimAction = claimAction;
 }