Esempio n. 1
0
        public void when_filtering_by_label_then_ANDS_the_result()
        {
            var github = new Octokit.Reactive.ObservableGitHubClient(
                new ProductHeaderValue("kzu-client"), new InMemoryCredentialStore(credentials));
			
            var issues = github.Issue.GetForRepository("xamarin", "XamarinVS", new RepositoryIssueRequest
            {
                Labels = { "Story", "story" }, 
                State = ItemState.Open,
                Since = DateTimeOffset.Now.Subtract(TimeSpan.FromDays(30)), 
            });

            var stories = new List<Issue>();
            var done = false;
            var subscription = issues.Subscribe(
                i => stories.Add(i),
                () => done = true);

            while (!done)
            {
                Thread.Sleep(100);
            }

            // NOTE: we get NOTHING since the labels are AND'ed together.
            Assert.Equal(0, stories.Count);
        }
Esempio n. 2
0
        public void when_retrieving_issues_then_can_filter_only_stories()
        {
            var github = new Octokit.Reactive.ObservableGitHubClient(
                new ProductHeaderValue("kzu-client"), new InMemoryCredentialStore(credentials));

            var issues = github.Issue.GetForRepository("xamarin", "XamarinVS", new RepositoryIssueRequest
            {
                Labels = { "Story" }, 
                State = ItemState.Open,
                Since = DateTimeOffset.Now.Subtract(TimeSpan.FromDays(30)), 
            });

            var done = false;
            var subscription = issues.Subscribe(
                i => 
                {
                    Console.WriteLine(i.Title);
                },
                () => done = true);

            while (!done)
            {
                Thread.Sleep(100);
            }
        }