コード例 #1
0
        public async Task CanGetEmail()
        {
            var github = Helper.GetAuthenticatedClient();

            var client = new ObservableUserEmailsClient(github);

            var email = await client.GetAll();
            Assert.NotNull(email);
        }
コード例 #2
0
            public void GetsCorrectUrlWithApiOption()
            {
                var github = Substitute.For<IGitHubClient>();
                var client = new ObservableUserEmailsClient(github);

                client.GetAll(ApiOptions.None);

                github.Connection.Received(1).Get<List<EmailAddress>>(_expectedUri,
                    Arg.Is<Dictionary<string, string>>(dictionary => dictionary.Count == 0), null);
            }
コード例 #3
0
            public void GetsCorrectUrl()
            {
                var expectedUri = new Uri("user/emails", UriKind.Relative);
                var github = Substitute.For<IGitHubClient>();
                var client = new ObservableUserEmailsClient(github);

                client.GetAll();

                github.Connection.Received(1).GetAsync<List<EmailAddress>>(expectedUri);
            }
コード例 #4
0
        public async Task CanGetEmail()
        {
            var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
            {
                Credentials = Helper.Credentials
            };
            var client = new ObservableUserEmailsClient(github);

            var email = await client.GetAll();
            Assert.NotNull(email);
        }