public void ShouldReturnNotFound_WhenIdNotFound() { var query = new GetPathQuery() { Id = 99999 }; FluentActions.Invoking(() => SendAsync(query)).Should().ThrowAsync <NotFoundException>(); }
public void GetOne_ShouldThrow_WhenCanceled() { var cts = new CancellationTokenSource(); cts.Cancel(); var query = new GetPathQuery() { Id = 1 }; FluentActions.Invoking(() => SendAsync(query, cts.Token)).Should().ThrowAsync <TaskCanceledException>(); }
public async Task GetOne_ShouldReturnPath() { var path = await AddAsync(new Path { Title = "Some Path", Key = "some-path", Description = "Some Path Description", Tags = new List <string> { "Tag1", "Tag2", "Tag3" } }); var query = new GetPathQuery() { Id = path.Id }; var result = await SendAsync(query); result.Title.Should().NotBeEmpty(); result.Tags.Should().HaveCount(3); }