Package com.jcabi.github

Examples of com.jcabi.github.UserEmails


     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void canAddEmails() throws Exception {
        final UserEmails emails = new MkGithub().users().get("john").emails();
        final String email = "john@nowhere.com";
        final Iterable<String> added = emails.add(
            Collections.singleton(email)
        );
        MatcherAssert.assertThat(
            added,
            Matchers.allOf(
View Full Code Here


     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void canRemoveEmails() throws Exception {
        final UserEmails emails = new MkGithub().users().get("joe").emails();
        final String removed = "joe@nowhere.com";
        final String retained = "joseph@somewhere.net";
        emails.add(
            Arrays.asList(
                new String[]{removed, retained}
            )
        );
        emails.remove(Collections.singleton(removed));
        MatcherAssert.assertThat(
            emails.iterate(),
            Matchers.allOf(
                Matchers.<String>iterableWithSize(1),
                Matchers.hasItems(retained),
                Matchers.not(Matchers.hasItems(removed))
            )
View Full Code Here

     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void canIterateEmails() throws Exception {
        final UserEmails emails = new MkGithub().users().get("matt").emails();
        final String[] added = new String[]{
            "matt@none.org",
            "matthew@somewhere.net",
        };
        emails.add(Arrays.asList(added));
        MatcherAssert.assertThat(
            emails.iterate(),
            Matchers.allOf(
                Matchers.<String>iterableWithSize(2),
                Matchers.hasItems(added)
            )
        );
View Full Code Here

     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void canRepresentAsJson() throws Exception {
        final UserEmails emails = new MkGithub().users().get("jeff").emails();
        final String email = "jeff@something.net";
        emails.add(Collections.singleton(email));
        MatcherAssert.assertThat(
            emails.json().getString("email"),
            Matchers.is(email)
        );
    }
View Full Code Here

TOP

Related Classes of com.jcabi.github.UserEmails

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.