Ejemplo n.º 1
0
        public void ListOfIntsAndStrings()
        {
            BenDecoder decoder = DecoderForString("li4e4:spame");
            IList      list    = decoder.ReadList();

            Assert.AreEqual(2, list.Count);
            Assert.AreEqual(4, list[0]);
            Assert.AreEqual("spam", list[1].ToString());
        }
Ejemplo n.º 2
0
        public void ListOfLists()
        {
            BenDecoder decoder = DecoderForString("li18el4:spam4:eggsee");
            IList      list    = decoder.ReadList();

            Assert.AreEqual(2, list.Count);
            Assert.AreEqual(18, list[0]);
            Assert.IsInstanceOfType(typeof(IList), list[1]);
        }
Ejemplo n.º 3
0
        public void ListOfStrings()
        {
            BenDecoder decoder = DecoderForString("l4:spam4:eggse");
            IList      list    = decoder.ReadList();

            Assert.AreEqual(2, list.Count);
            Assert.AreEqual("spam", list[0].ToString());
            Assert.AreEqual("eggs", list[1].ToString());
        }