protected virtual void ValidatePosition(RomanCalculator connector) { var afterNumbers = connector.After(this); if (!afterNumbers.IsNullOrEmpty() && !(afterNumbers.All(o => o.Value <= this.Value))) { throw new Exception($"{this.Symbol} can nerver be subtracted."); } }
protected override void ValidatePosition(RomanCalculator connector) { var afterNumbers = connector.After(this); if (!afterNumbers.IsNullOrEmpty() && !(afterNumbers.All(o => o.Value <= this.Value || new[] { SymbolEnum.D, SymbolEnum.M }.Contains(o.Symbol)))) { throw new Exception($"{this.Symbol} can be only subtracted from {SymbolEnum.D} {SymbolEnum.M}."); } }