Example #1
0
 public void ReadkeyCommandHandlerExecuteShouldThrowForNullCommand()
 {
     var readkeyHandler = new ReadkeyCommandHandler(this.keyMapService, this.mainWindow);
     readkeyHandler.Invoking(t => t.Execute(null))
                   .ShouldThrow<ArgumentNullException>()
                   .And.ParamName.Should()
                   .Be("command");
 }
Example #2
0
        public async Task ReadkeyCommandHandlerExecuteWaitsForNextKeySequenceOfTopKey()
        {
            this.keyMapService.AddKeyMap("dummyKeyMap");
            this.keyMapService.SetTopKey("dummyKeyMap", Keys.T);

            var readkeyHandler = new ReadkeyCommandHandler(this.keyMapService, this.mainWindow);
            await readkeyHandler.Execute(new ReadkeyCommand { Args = "dummyKeyMap" });

            this.mainWindow.Received(1).WaitForNextKeyAsync(Keys.T);
        }
Example #3
0
 public void ReadkeyCommandHandlerExecuteShouldThrowForNullKeyMapName()
 {
     var readkeyHandler = new ReadkeyCommandHandler(this.keyMapService, this.mainWindow);
     readkeyHandler.Invoking(t => t.Execute(new ReadkeyCommand())).ShouldThrow<ArgumentException>();
 }