示例#1
0
        public void TestKeyAndValue()
        {
            List <KeyValuePair <StackItem, StackItem> > list = new List <KeyValuePair <StackItem, StackItem> >();
            StackItem stackItem1 = new Integer(0);
            StackItem stackItem2 = new Integer(1);

            list.Add(new KeyValuePair <StackItem, StackItem>(stackItem1, stackItem2));
            MapWrapper mapWrapper = new MapWrapper(list);

            mapWrapper.Next();
            Assert.AreEqual(stackItem1, mapWrapper.Key());
            Assert.AreEqual(stackItem2, mapWrapper.Value());
        }
示例#2
0
        public void TestKeyAndValue()
        {
            List <KeyValuePair <PrimitiveType, StackItem> > list = new List <KeyValuePair <PrimitiveType, StackItem> >();
            Integer   stackItem1 = new Integer(0);
            StackItem stackItem2 = new Integer(1);

            list.Add(new KeyValuePair <PrimitiveType, StackItem>(stackItem1, stackItem2));
            MapWrapper mapWrapper = new MapWrapper(list, null);

            mapWrapper.Next();
            Struct @struct = (Struct)mapWrapper.Value();

            Assert.AreEqual(stackItem1, @struct[0]);
            Assert.AreEqual(stackItem2, @struct[1]);
        }