public void SetupDictionary()
 {
     _dictionary = new CoralDictionary()
     {
         { 0, "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" },
         { 1, "http://www.iana.org/assignments/relation/item>" },
         { 2, "http://www.iana.org/assignments/relation/collection" },
         { 3, CBORObject.FromObject(93.56) },
         { 4, new Cori("coap://host:99/path1/path2/path3") },
         { 5, CBORObject.FromObjectAndTag(0, 1) },
         { 6, CBORObject.FromObject(new byte[] { 1, 3, 5, 7, 9, 11, 13, 15 }) },
     };
 }
        public void OneLink()
        {
            CoralLink link = new CoralLink("http://coreapps.org/reef#rd-unit", "/sensors");

            StringBuilder sb = new StringBuilder();

            link.BuildString(sb, "", null, null);

            Assert.AreEqual("<http://coreapps.org/reef#rd-unit> \"/sensors\"\n", sb.ToString());

            CoralDictionary dictionary = new CoralDictionary();

            CBORObject obj = link.EncodeToCBORObject(null, dictionary);

            Assert.AreEqual("[2, [0, \"http\", 1, \"coreapps.org\", 5, \"reef\", 7, \"rd-unit\"], \"/sensors\"]", obj.ToString());

            dictionary.Add(99, new Cori("http://coreapps.org/reef#rd-unit"));
            obj = link.EncodeToCBORObject(null, dictionary);
            Assert.AreEqual("[2, 99, \"/sensors\"]", obj.ToString());

            dictionary.Add(98, "/sensors");
            obj = link.EncodeToCBORObject(null, dictionary);
            Assert.AreEqual("[2, 99, 99999(98)]", obj.ToString());
        }