コード例 #1
0
            public async Task EnsuresArgumentsNotNull()
            {
                var client       = Substitute.For <IApiConnection>();
                var authEndpoint = new AuthorizationsClient(client);

                await Assert.ThrowsAsync <ArgumentNullException>(() => authEndpoint.GetAll(null));
            }
コード例 #2
0
            public async Task EnsuresArgumentsNotNull()
            {
                var client = Substitute.For<IApiConnection>();
                var authEndpoint = new AuthorizationsClient(client);

                await Assert.ThrowsAsync<ArgumentNullException>(() => authEndpoint.GetAll(null));
            }
コード例 #3
0
            public void GetsAListOfAuthorizations()
            {
                var client       = Substitute.For <IApiConnection>();
                var authEndpoint = new AuthorizationsClient(client);

                authEndpoint.GetAll();

                client.Received().GetAll <Authorization>(Arg.Is <Uri>(u => u.ToString() == "authorizations"));
            }
コード例 #4
0
            public void GetsAListOfAuthorizations()
            {
                var client = Substitute.For<IApiConnection>();
                var authEndpoint = new AuthorizationsClient(client);

                authEndpoint.GetAll();

                client.Received().GetAll<Authorization>(Arg.Is<Uri>(u => u.ToString() == "authorizations"));
            }
コード例 #5
0
            public void RequestsCorrectUrl()
            {
                var client       = Substitute.For <IApiConnection>();
                var authEndpoint = new AuthorizationsClient(client);

                authEndpoint.GetAll();

                client.Received().GetAll <Authorization>(
                    Arg.Is <Uri>(u => u.ToString() == "authorizations"),
                    Args.ApiOptions);
            }
コード例 #6
0
            public void RequestsCorrectUrl()
            {
                var client = Substitute.For<IApiConnection>();
                var authEndpoint = new AuthorizationsClient(client);

                authEndpoint.GetAll();

                client.Received().GetAll<Authorization>(
                    Arg.Is<Uri>(u => u.ToString() == "authorizations"),
                    Args.ApiOptions);
            }
コード例 #7
0
            public void RequestsCorrectUrlWithApiOptions()
            {
                var client       = Substitute.For <IApiConnection>();
                var authEndpoint = new AuthorizationsClient(client);

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

                authEndpoint.GetAll(options);

                client.Received().GetAll <Authorization>(
                    Arg.Is <Uri>(u => u.ToString() == "authorizations"),
                    options);
            }
コード例 #8
0
            public void RequestsCorrectUrlWithApiOptions()
            {
                var client = Substitute.For<IApiConnection>();
                var authEndpoint = new AuthorizationsClient(client);

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

                authEndpoint.GetAll(options);

                client.Received().GetAll<Authorization>(
                    Arg.Is<Uri>(u => u.ToString() == "authorizations"),
                    options);
            }