public TResult ExecuteWhenAs(IActor actor) { if (_executableAction.Actions.IsEmpty) { return(Action.ExecuteWhenAs(actor)); } else { _executableAction.ExecuteWhenAs(actor); return(actor.Execute(Action)); } }
public void ExecuteWhenAs_ShouldCallActorExecute( CompositeAction sut, Mock <IActor> actor ) { //arrange //act sut.ExecuteWhenAs(actor.Object); //assert foreach (var action in sut.Actions) { actor.Verify(a => a.Execute(action), Times.Once()); } }