コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }