public async Task Should_Error_ForInvalidModelState()
        {
            var data = new AddWordPostModel
            {
                Word    = "Bonjour",
                Answers = new [] { "Hello", "Good Morning" }
            };

            var mockHandler = new MockCommandHandler <AddWordCommand>().ReturnsForAll().Handler;
            var controller  = new WordsController(mockHandler, null);

            controller.ModelState.AddModelError(string.Empty, "Something is wrong!");

            var result = await controller.AddWord(data);

            result.Should().BeOfType <BadRequestObjectResult>();
        }
        public async Task Should_AddWord(string word, string[] answers)
        {
            var data = new AddWordPostModel
            {
                Word    = word,
                Answers = answers
            };
            var mockCommandHandler = new MockCommandHandler <AddWordCommand>().ReturnsForAll().Handler;
            var mockQueryHandler   = new MockQueryHandler <FindItemsQuery, LearningItem[]>()
                                     .ReturnsForAll(new [] { new LearningItem(word, answers) })
                                     .Handler;
            var controller = new WordsController(mockCommandHandler, mockQueryHandler);

            var result = await controller.AddWord(data);

            result.Should().BeOfType <CreatedResult>();
            var createdResult = (CreatedResult)result;

            createdResult.StatusCode.Should().Be(201);
            createdResult.Location.Should().MatchRegex(@"\/Words\/[{(]?[0-9A-Fa-f]{8}[-]?([0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}[)}]?");
        }