public async Task TestListApiVersions()
        {
            using (CancellationTokenSource cancellationTokenSource = new CancellationTokenSource())
            {
                cancellationTokenSource.CancelAfter(TestTimeout(TimeSpan.FromSeconds(10)));

                using (IBaseIdentityService service = CreateService())
                {
                    ListApiVersionsApiCall apiCall = await service.PrepareListApiVersionsAsync(cancellationTokenSource.Token);

                    Tuple <HttpResponseMessage, ReadOnlyCollectionPage <ApiVersion> > response = await apiCall.SendAsync(cancellationTokenSource.Token);

                    Assert.IsNotNull(response);
                    Assert.IsNotNull(response.Item1);

                    ReadOnlyCollectionPage <ApiVersion> versions = response.Item2;
                    Assert.IsNotNull(versions);
                    Assert.AreNotEqual(0, versions.Count);
                    Assert.IsFalse(versions.CanHaveNextPage);
                    Assert.IsFalse(versions.Contains(null));

                    foreach (ApiVersion version in versions)
                    {
                        Assert.IsNotNull(version);
                        Assert.IsNotNull(version.Id);
                        Assert.IsNotNull(version.LastModified);
                        Assert.IsFalse(version.MediaTypes.IsDefault);
                        Assert.IsFalse(version.Links.IsDefault);
                        Assert.IsNotNull(version.Status);

                        Assert.AreNotEqual(0, version.MediaTypes.Length);
                        foreach (MediaType mediaType in version.MediaTypes)
                        {
                            Assert.IsNotNull(mediaType);
                            Assert.IsNotNull(mediaType.Base);
                            Assert.IsNotNull(mediaType.Type);
                        }

                        Assert.AreNotEqual(0, version.Links.Length);
                        foreach (Link link in version.Links)
                        {
                            Assert.IsNotNull(link);
                            Assert.IsNotNull(link.Target);
                            Assert.IsNotNull(link.Relation);
                            Assert.IsTrue(link.Target.IsAbsoluteUri);
                        }
                    }
                }
            }
        }
        public async Task TestListApiVersionsSimple()
        {
            using (CancellationTokenSource cancellationTokenSource = new CancellationTokenSource())
            {
                cancellationTokenSource.CancelAfter(TestTimeout(TimeSpan.FromSeconds(10)));

                using (IBaseIdentityService service = CreateService())
                {
                    // test using the simple extension method
                    ReadOnlyCollectionPage <ApiVersion> versions = await service.ListApiVersionsAsync(cancellationTokenSource.Token);

                    Assert.IsNotNull(versions);
                    Assert.AreNotEqual(0, versions.Count);
                    Assert.IsFalse(versions.CanHaveNextPage);
                    Assert.IsFalse(versions.Contains(null));
                }
            }
        }