示例#1
0
 public ReadkeyCommandTests()
 {
     this.platformFacade = Substitute.For<IPlatformFacade>();
     this.platformFacade.RegisterHotKey(Keys.None, 0).ReturnsForAnyArgs(true);
     this.keyMapService = new KeyMapService(this.platformFacade);
     this.mainWindow = Substitute.For<IMainWindow>();
 }
示例#2
0
        public DefinekeyCommandTests()
        {
            this.platformFacade = Substitute.For<IPlatformFacade>();
            this.keyMapService = new KeyMapService(this.platformFacade);

            var commandStub = new ICommandStub
                                    {
                                        Args = "arg1",
                                        Name = "testCommand",
                                        Help = "sample help!"
                                    };
            var commandHandlerStub = new ICommandHandlerStub
                       {
                           ExpectedCommandArgs = commandStub.Args,
                           ExpectedCommandName = commandStub.Name,
                           ExpectedCommandHelp = commandStub.Help,
                           ExpectedExecuteResult = () => true
                       };
            this.commandService = new CommandService(
                new List<ICommand> { commandStub }, new List<object> { commandHandlerStub });
        }
示例#3
0
 public NewKMapCommandTests()
 {
     this.platformFacade = NSubstitute.Substitute.For<IPlatformFacade>();
     this.keyMapService = new KeyMapService(this.platformFacade);
 }
示例#4
0
 public DelKMapCommandTests()
 {
     this.platformFacade = Substitute.For<IPlatformFacade>();
     this.platformFacade.UnregisterHotKey(0).ReturnsForAnyArgs(true);
     this.keyMapService = new KeyMapService(this.platformFacade);
 }