Ejemplo n.º 1
0
        public void SerializesEmptyCollection()
        {
            serializer.Serialize(outputStream, new List <PackageWithUrls>(), serviceUrl);
            var feed = XmlFeedHelper.ParsePage(readDocument());

            Assert.Empty(feed);
        }
Ejemplo n.º 2
0
        public void SerializesMinimalPackage()
        {
            var pkg = new ODataPackage()
            {
                Id      = "Minimal",
                Version = "1.0.0"
            };

            serializer.Serialize(outputStream, pkg, serviceUrl, resourceUrl, packageContentUrl);
            var feed  = XmlFeedHelper.ParsePage(readDocument());
            var entry = Assert.Single(feed);

            Assert.Equal("Minimal", entry.Id);
            Assert.Equal(NuGetVersion.Parse("1.0.0"), entry.Version);
        }
Ejemplo n.º 3
0
        public void SerializesCollectionOf2()
        {
            serializer.Serialize(outputStream, new PackageWithUrls[] {
                new PackageWithUrls(new ODataPackage()
                {
                    Id      = "Minimal",
                    Version = "1.0.0"
                }, resourceUrl, packageContentUrl),
                new PackageWithUrls(new ODataPackage()
                {
                    Id      = "Minimal",
                    Version = "1.1.0"
                }, "http://repo/pkg/1.1", "http://repo/contents/pkg/1.1")
            }, serviceUrl);
            var feed = XmlFeedHelper.ParsePage(readDocument()).ToList();

            Assert.Equal(2, feed.Count);
            Assert.Equal(new [] { "1.0.0", "1.1.0" }, feed.Select(f => f.Version.OriginalVersion));
        }