public void PostsToCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new UserEmailsClient(connection);

                client.Add("*****@*****.**");

                connection.Received(1)
                .Post <IReadOnlyList <EmailAddress> >(Arg.Is <Uri>(u => u.ToString() == "user/emails"), Arg.Any <string[]>());
            }
            public void PostsToCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new UserEmailsClient(connection);

                client.Add("*****@*****.**");

                connection.Received(1)
                    .Post<IReadOnlyList<EmailAddress>>(Arg.Is<Uri>(u => u.ToString() == "user/emails"), Arg.Any<string[]>());
            }
 public async Task EnsuresNoNullEmails()
 {
     var client = new UserEmailsClient(Substitute.For <IApiConnection>());
     await Assert.ThrowsAsync <ArgumentException>(() => client.Add("*****@*****.**", null));
 }
 public async Task EnsuresNonNullArgument()
 {
     var client = new UserEmailsClient(Substitute.For <IApiConnection>());
     await Assert.ThrowsAsync <ArgumentNullException>(() => client.Add(null));
 }
            public void EnsuresNonNullArgument()
            {
                var client = new UserEmailsClient(Substitute.For <IApiConnection>());

                Assert.Throws <ArgumentNullException>(() => client.Add(null));
            }
 public async Task EnsuresNoNullEmails()
 {
     var client = new UserEmailsClient(Substitute.For<IApiConnection>());
     await Assert.ThrowsAsync<ArgumentException>(() => client.Add("*****@*****.**", null));
 }
 public async Task EnsuresNonNullArgument()
 {
     var client = new UserEmailsClient(Substitute.For<IApiConnection>());
     await Assert.ThrowsAsync<ArgumentNullException>(() => client.Add(null));
 }
 public void EnsuresNonNullArgument()
 {
     var client = new UserEmailsClient(Substitute.For<IApiConnection>());
     Assert.Throws<ArgumentNullException>(() => client.Add(null));
 }