public void ClaimWarranty(Action onValidClaim) { switch (_operationalStatus) { case DeviceStatusEnum.AllFine: _moneyBackGuarantee.Claim(DateTime.Now, onValidClaim); break; case DeviceStatusEnum.NotOperational: case DeviceStatusEnum.NotOperational | DeviceStatusEnum.VisiblyDamaged: case DeviceStatusEnum.NotOperational | DeviceStatusEnum.CircuitFailed: case DeviceStatusEnum.NotOperational | DeviceStatusEnum.VisiblyDamaged | DeviceStatusEnum.CircuitFailed: _notOperationalWarranty.Claim(DateTime.Now, onValidClaim); break; case DeviceStatusEnum.VisiblyDamaged: break; case DeviceStatusEnum.CircuitFailed: case DeviceStatusEnum.VisiblyDamaged | DeviceStatusEnum.CircuitFailed: _circuits.Do(circuit => _circuitWarranty.Claim(circuit.BreakDate, onValidClaim)); break; } }
public void ClaimCircuitWarranty(Action onValidClaim) { _circuits.Do(circuit => _circuitExtendedWarranty.Claim(circuit.BreakDate, onValidClaim)); }
private void ClaimMoneyBack(Action action) { _notOperationalWarranty.Claim(DateTime.Now, action); }