# This is just an example to get you started. You may wish to put all of your # tests into a single file, or separate them into multiple `test1`, `test2` # etc. files (better names are recommended, just make sure the name starts with # the letter 't'). # # To run these tests, simply execute `nimble test`. import unittest import marshal import FeedNim import ../src/FeedNim/atom test "Read Valid Atom Feed": let feed = "./tests/test_atom.xml".loadAtom() check feed.id == "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6" check feed.title == "Bloggs's Planes Trains and Automobiles" check feed.updated == "2003-12-13T18:30:02Z" check feed.author.name == "Joe Bloggs" check feed.author.uri == "http://joe.bloggs" check feed.author.email == "mail@joe.bloggs" check feed.contributors[0].name == "Jane Bloggs" check feed.categories[0].term == "planes" check feed.categories[0].label == "Planes" check feed.categories[0].scheme == "http://awesomecategories.org" check feed.categories[1].term == "trains" check feed.categories[1].label == "Trains" check feed.categories[2].term == "automobiles" check feed.categories[2].label == "Automobiles" let feed_generator_uri = feed.generator.uri check feed_generator_uri == "https://github.com/dom96/jester" let feed_generator_text:string = feed.generator check feed.generator == "Jester" check feed.icon == "http://joe.bloggs/mug,jpg" check feed.link.href == "http://joe.bloggs/atom" check feed.link.rel == "self" check feed.link.linktype == "application/xml+atom" check feed.link.hreflang == "en-GB" check feed.link.title == "Bloggs's Planes Trains and Automobiles" check feed.link.length == 1000000 check feed.logo == "http://joe.bloggs/logo.jpeg" check feed.rights == "Copyright Joe and Jane Bloggs" check feed.subtitle == "About Trains, Planes, and Automobiles." check feed.entries[0].id == "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a" check feed.entries[0].title == "Aeroplanes not Airplanes" check feed.entries[0].updated == "2003-12-13T18:30:02Z" check feed.entries[0].author.name == "Joe Bloggs" check feed.entries[0].author.uri == "http://joe.bloggs" check feed.entries[0].author.email == "mail@joe.bloggs" check feed.entries[0].categories[0].term == "words" check feed.entries[0].categories[0].label == "Words" check feed.entries[0].categories[0].scheme == "http://awesomecategories.org" var feed_0_content_textType = feed.entries[0].content.textType check feed_0_content_textType == "xhtml" var feed_0_content_text: string = feed.entries[0].content check feed_0_content_text == """
Aero- not air-, fools!