Exemple #1
0
        public MockResponse BuildV3IndexResponse(string serverUri)
        {
            var indexJson = FeedUtilities.CreateIndexJson();

            FeedUtilities.AddFlatContainerResource(indexJson, serverUri);
            FeedUtilities.AddRegistrationResource(indexJson, serverUri);

            return new MockResponse
            {
                ContentType = "text/javascript",
                Content = Encoding.UTF8.GetBytes(indexJson.ToString())
            };
        }
Exemple #2
0
        public MockResponse BuildRegistrationIndexResponse(string serverUri, KeyValuePair<PackageIdentity, bool>[] packageIdentityToListed)
        {
            var id = packageIdentityToListed[0].Key.Id.ToLowerInvariant();
            var versions = packageIdentityToListed.Select(
                e => new KeyValuePair<string, bool>(
                    e.Key.Version.ToNormalizedString().ToLowerInvariant(),
                    e.Value));
            var registrationIndex = FeedUtilities.CreatePackageRegistrationBlob(serverUri, id, versions);

            return new MockResponse
            {
                ContentType = "text/javascript",
                Content = Encoding.UTF8.GetBytes(registrationIndex.ToString())
            };
        }