Esempio n. 1
0
            public void RequestsCorrectUrl()
            {
                var endpoint = new Uri("user/subscriptions", UriKind.Relative);
                var connection = Substitute.For<IApiConnection>();
                var client = new WatchedClient(connection);

                client.GetAllForCurrent();

                connection.Received().GetAll<Repository>(endpoint);
            }
Esempio n. 2
0
            public async Task RequestsCorrectUrlWithApiOptions()
            {
                var endpoint   = new Uri("user/subscriptions", UriKind.Relative);
                var connection = Substitute.For <IApiConnection>();
                var client     = new WatchedClient(connection);

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

                await client.GetAllForCurrent(options);

                connection.Received().GetAll <Repository>(endpoint, options);
            }
            public async Task RequestsCorrectUrlWithApiOptions()
            {
                var endpoint = new Uri("user/subscriptions", UriKind.Relative);
                var connection = Substitute.For<IApiConnection>();
                var client = new WatchedClient(connection);

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

                await client.GetAllForCurrent(options);

                connection.Received().GetAll<Repository>(endpoint, options);
            }
Esempio n. 4
0
            public async Task EnsuresNonNullArguments()
            {
                var client = new WatchedClient(Substitute.For <IApiConnection>());

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllForCurrent(null));
            }
            public async Task EnsuresNonNullArguments()
            {
                var client = new WatchedClient(Substitute.For<IApiConnection>());

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForCurrent(null));
            }