public void GivenCreateHanoiCommandWithTotalDisksLessThanOneShouldReturnNull() { var createHanoi = new CreateHanoiCommand { DiskCount = 1 }; var result = _hanoiCommandsHandler.Handle(createHanoi); Assert.IsNull(result); Assert.AreEqual(_hanoiCommandsHandler.Notifications.First(x => x.Property == "TotalDisks").Message, "The Hanoi Tower needs at least 2 disks to be played"); }
public async Task <HttpResponseMessage> Post([FromBody] CreateHanoiCommand command) { var result = _hanoiCommandsHandler.Handle(command); if (!string.IsNullOrEmpty(result.Id)) { BackgroundJob.Enqueue(() => ProcessHanoi(Guid.Parse(result.Id))); } return(await Response(result, _hanoiCommandsHandler.Notifications)); ; }