public void CopyVisitors_ShouldCallAddVisitor( CommandBuilderProvider sut, IMvvmCommandVisitor[] visitors, Mock <ICommandBuilderProvider> other) { //arrange foreach (var mvvmCommandVisitor in visitors) { sut.AddVisitor(mvvmCommandVisitor); other.Setup(c => c.AddVisitor(mvvmCommandVisitor)).Verifiable(); } //act sut.CopyVisitors(other.Object); //assert other.Verify(); }
public void Get_ShouldCallAccept( string name, ISchedulers schedulers, Mock <ICommandBuilder> commandBuilder, Mock <IMvvmCommand> command, IMvvmCommandVisitor visitor) { //arrange Action <ICommand> action = null; var sut = new CommandBuilderProvider(schedulers, (action1, schedulers1, n) => { action = action1; return(commandBuilder.Object); }); sut.AddVisitor(visitor); //act sut.Get(""); action(command.As <ICommand>().Object); //assert command.Verify(c => c.Accept(visitor)); }