Exemple #1
0
        public void TestMultipleParse()
        {
            var result = WebLinksCollection.Parse("</entries?page=2>; rel=\"next\", </entries?page=9>; rel=\"last\"");

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count == 2);
        }
Exemple #2
0
        public void TestEmpty()
        {
            var result = WebLinksCollection.Parse("");

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count == 0);
        }
        public void TestCollectionToString()
        {
            var collection = new WebLinksCollection();

            collection.Add(new WebLink()
            {
                Url   = "/test",
                Rel   = "prev",
                Title = "my-title"
            });

            Assert.AreEqual("</test>; rel=\"prev\" title=\"my-title\"", collection.ToString());
        }
Exemple #4
0
        public void TestSimpleParse()
        {
            var result = WebLinksCollection.Parse("</entries?page=2>; rel=\"next\" title=\"This is a test\"");

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count == 1);

            var webLink = result[0];

            Assert.AreEqual("/entries?page=2", webLink.Url, "Url property");
            Assert.AreEqual("next", webLink.Rel, "Rel property");
            Assert.AreEqual("This is a test", webLink.Title, "Title proprty");
        }
Exemple #5
0
 public void TestNull()
 {
     WebLinksCollection.Parse(null);
 }