예제 #1
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);
            }
예제 #2
0
        public async Task CanGetEmail()
        {
            var github = Helper.GetAuthenticatedClient();

            var client = new ObservableUserEmailsClient(github);

            var email = await client.GetAll();

            Assert.NotNull(email);
        }
예제 #3
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);
            }
        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);
        }
        public async Task CanGetEmail()
        {
            var email = await _emailClient.GetAll();

            Assert.NotNull(email);
        }