public async Task Get_project_by_slug_returns_project() { var client = SentryApiClientFactory.Create(); var pagedCollection = await client.Projects.GetAsync(); var firstProject = pagedCollection.Collection.First(); var project = await client.Projects.GetAsync(new SentryRequest(firstProject.Organization.Slug, firstProject.Slug)); Assert.NotNull(project); }
public async Task Get_issues_with_filter_doest_thrown_an_exception() { var client = SentryApiClientFactory.Create(); var projects = await client.Projects.GetAsync().ConfigureAwait(false); var project = projects.Collection.First(); var exception = await Record.ExceptionAsync(async() => await client.Events.GetIssuesAsync(new IssuesRequest(project.Organization.Slug, project.Slug, "is:unresolved is:assigned", Period.Day)).ConfigureAwait(false)); Assert.Null(exception); }
public async Task Move_forward_and_back_collection_has_the_same_projects() { var client = SentryApiClientFactory.Create(); var collection = await client.Projects.GetAsync().ConfigureAwait(false); var nextPage = await client.LoadNextPageAsync(collection); var previousPage = await client.LoadPreviousPageAsync(nextPage); Assert.Contains(previousPage.Collection, project => collection.Collection.Any(c => c.Slug == project.Slug)); }
public async Task Get_issues_return_result() { var client = SentryApiClientFactory.Create(); var projects = await client.Projects.GetAsync().ConfigureAwait(false); var project = projects.Collection.First(); var exception = await Record.ExceptionAsync(async() => await client.Events.GetIssuesAsync(new IssuesRequest(project.Organization.Slug, project.Slug)).ConfigureAwait(false)); Assert.Null(exception); }
public async Task Get_projects_returns_any_projects() { var client = SentryApiClientFactory.Create(); var pagedCollection = await client.Projects.GetAsync(); var allProjects = new List <Project>(pagedCollection.Collection); while (pagedCollection.Pagination.HasNext) { pagedCollection = await client.LoadNextPageAsync(pagedCollection); allProjects.AddRange(pagedCollection.Collection); } Assert.NotEmpty(pagedCollection.Collection); }