Example #1
0
        public void ShouldRequireValidTermId()
        {
            var command = new GetTermDetailQuery()
            {
                Id = 99
            };

            FluentActions.Invoking(() =>
                                   SendAsync(command)).Should().Throw <NotFoundException>();
        }
Example #2
0
        public async Task ShouldReturnTermAssociatedWithId()
        {
            var command = new CreateTermCommand
            {
                TermText   = "Test Term",
                Definition = "Test Definition"
            };

            var termCreated = await SendAsync(command);

            var query = new GetTermDetailQuery
            {
                Id = termCreated.Id
            };

            var result = await SendAsync(query);

            result.TermText.Should().Be(termCreated.TermText);
            result.Definition.Should().Be(termCreated.Definition);
        }