public OnHandling ( dynamic command ) : void | ||
command | dynamic | |
Résultat | void |
public void It_calls_OnProcessing_and_OnProcessed_on_same_instances_of_filters() { var collection = new FilterCollection(GetFilterInstances()); var command = new TestCommand(); var result = new object(); collection.OnHandling(command); collection.OnHandled(command, result); }
public void It_executes_all_filters_before_handling() { var filterOne = new Mock <IFilter <TestCommand> >(); var filterTwo = new Mock <IFilter <TestCommand> >(); var collection = new FilterCollection(new object[] { filterOne.Object, filterTwo.Object }); var command = new TestCommand(); collection.OnHandling(command); filterOne.Verify(x => x.OnHandling(command)); filterTwo.Verify(x => x.OnHandling(command)); }