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()); }
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]); }
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()); }