Example #1
0
        public async Task DelKMapCommandHandlerExecuteShouldDeleteAKeyMapWithGivenName()
        {
            var delkmapHandler = new DelKMapCommandHandler(this.keyMapService);
            var newkmapHandler = new NewKMapCommandHandler(this.keyMapService);
            (await newkmapHandler.Execute(new NewKMapCommand { Args = "dummyKeyMap" })).Should().BeTrue();

            var result = await delkmapHandler.Execute(new DelKMapCommand { Args = "dummyKeyMap" });
            result.Should().BeTrue();

            var getKeyMap = new Action(() => this.keyMapService.GetKeyMapByName("dummyKeyMap"));
            getKeyMap.ShouldThrow<KeyNotFoundException>();
        }
Example #2
0
 public void DelKMapCommandHandlerExecuteShouldThrowForNonExistentKeyMap()
 {
     var delkmapHandler = new DelKMapCommandHandler(this.keyMapService);
     Func<Task> action = async () => await delkmapHandler.Execute(new DelKMapCommand { Args = "dummyKeyMap" });
     action.ShouldThrow<KeyNotFoundException>();
 }
Example #3
0
 public async Task DelKMapCommandHandlerExecuteReturnsFalseForACommandWithNullArguments()
 {
     var delkmapHandler = new DelKMapCommandHandler(this.keyMapService);
     (await delkmapHandler.Execute(new DelKMapCommand())).Should().BeFalse();
 }