public CalculationGraphWithEvents(ICalculationGraph decoratedGraph,
                                   Action <IStat> statAddedAction, Action <IStat> statRemovedAction)
 {
     _decoratedGraph    = decoratedGraph;
     _statAddedAction   = statAddedAction;
     _statRemovedAction = statRemovedAction;
 }
        private static CalculationGraphWithEvents CreateSut(
            ICalculationGraph decoratedGraph,
            Action <IStat>?statAddedAction = null, Action <IStat>?statRemovedAction = null)
        {
            var sut = new CalculationGraphWithEvents(decoratedGraph);

            if (statAddedAction != null)
            {
                sut.StatAdded += statAddedAction;
            }
            if (statRemovedAction != null)
            {
                sut.StatRemoved += statRemovedAction;
            }
            return(sut);
        }
示例#3
0
 private static PrunableCalculationGraph CreateSut(ICalculationGraph decoratedGraph) =>
 new PrunableCalculationGraph(decoratedGraph, MockDeterminesNodeRemoval());
 public PrunableCalculationGraph(ICalculationGraph decoratedGraph, IDeterminesNodeRemoval nodeRemovalDeterminer)
 {
     _decoratedGraph        = decoratedGraph;
     _nodeRemovalDeterminer = nodeRemovalDeterminer;
 }
 public CalculationGraphPruner(ICalculationGraph calculationGraph, IGraphPruningRuleSet ruleSet)
 => (_calculationGraph, _ruleSet) = (calculationGraph, ruleSet);
 private static CalculationGraphPruner CreateSut(
     ICalculationGraph decoratedGraph, IGraphPruningRuleSet ruleSet)
 => new CalculationGraphPruner(decoratedGraph, ruleSet);
 private static CalculationGraphPruner CreateSut(ICalculationGraph decoratedGraph)
 => CreateSut(decoratedGraph, new DefaultPruningRuleSet(MockDeterminesNodeRemoval()));
示例#8
0
 public CalculationGraphWithEvents(ICalculationGraph decoratedGraph)
 => _decoratedGraph = decoratedGraph;
示例#9
0
 private static CalculationGraphWithEvents CreateSut(
     ICalculationGraph decoratedGraph,
     Action <IStat> statAddedAction = null, Action <IStat> statRemovedAction = null)
 {
     return(new CalculationGraphWithEvents(decoratedGraph, statAddedAction, statRemovedAction ?? (_ => { })));
 }