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

                client.GetAll();

                connection.Received(1)
                .GetAll <EmailAddress>(Arg.Is <Uri>(u => u.ToString() == "user/emails"));
            }
            public void GetsCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new UserEmailsClient(connection);

                client.GetAll();

                connection.Received(1)
                    .GetAll<EmailAddress>(Arg.Is<Uri>(u => u.ToString() == "user/emails"));
            }
            public void RequestsCorrectUrlWithApiOptions()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new UserEmailsClient(connection);

                var options = new ApiOptions
                {
                    PageCount = 1,
                    PageSize  = 1,
                    StartPage = 1
                };

                client.GetAll(options);

                connection.Received(1)
                .GetAll <EmailAddress>(Arg.Is <Uri>(u => u.ToString() == "user/emails"),
                                       options);
            }
            public void RequestsCorrectUrlWithApiOptions()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new UserEmailsClient(connection);

                var options = new ApiOptions
                {
                    PageCount = 1,
                    PageSize = 1,
                    StartPage = 1
                };

                client.GetAll(options);

                connection.Received(1)
                    .GetAll<EmailAddress>(Arg.Is<Uri>(u => u.ToString() == "user/emails"),
                        options);
            }
            public async Task EnsuresNonNullArguments()
            {
                var releasesClient = new UserEmailsClient(Substitute.For <IApiConnection>());

                await Assert.ThrowsAsync <ArgumentNullException>(() => releasesClient.GetAll(null));
            }
            public async Task EnsuresNonNullArguments()
            {
                var releasesClient = new UserEmailsClient(Substitute.For<IApiConnection>());

                await Assert.ThrowsAsync<ArgumentNullException>(() => releasesClient.GetAll(null));
            }