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>(); }
public void DelKMapCommandHandlerExecuteShouldThrowForNonExistentKeyMap() { var delkmapHandler = new DelKMapCommandHandler(this.keyMapService); Func<Task> action = async () => await delkmapHandler.Execute(new DelKMapCommand { Args = "dummyKeyMap" }); action.ShouldThrow<KeyNotFoundException>(); }
public async Task DelKMapCommandHandlerExecuteReturnsFalseForACommandWithNullArguments() { var delkmapHandler = new DelKMapCommandHandler(this.keyMapService); (await delkmapHandler.Execute(new DelKMapCommand())).Should().BeFalse(); }