示例#1
0
        public void InsertContentsTest()
        {
            IWDT iwdt = new IWDT();

            IEnumerable <KeyValuePair <Tuple <int, int>, Tuple <int, int> > > contents =
                new KeyValuePair <Tuple <int, int>, Tuple <int, int> >[] {
                new KeyValuePair <Tuple <int, int>, Tuple <int, int> > (Tuple.Create(1, 1), Tuple.Create(2, 1)),
                new KeyValuePair <Tuple <int, int>, Tuple <int, int> > (Tuple.Create(3, 1), Tuple.Create(7, 1)),
                new KeyValuePair <Tuple <int, int>, Tuple <int, int> > (Tuple.Create(5, 1), Tuple.Create(13, 1))
            }
            ;

            iwdt.InsertContents(contents);

            Assert.AreEqual(Tuple.Create(2, 1), iwdt.GetItem(HT(1, 2)));
            Assert.AreEqual(Tuple.Create(7, 1), iwdt.GetItem(HT(3, 2)));
            Assert.AreEqual(Tuple.Create(13, 1), iwdt.GetItem(HT(5, 2)));
        }
示例#2
0
        public void ClearTest()
        {
            IWDT iwdt         = new IWDT();
            var  asCollection = (ICollection <KeyValuePair <Tuple <int, int>, Tuple <int, int> > >)iwdt;

            IEnumerable <KeyValuePair <Tuple <int, int>, Tuple <int, int> > > contents =
                new KeyValuePair <Tuple <int, int>, Tuple <int, int> >[] {
                new KeyValuePair <Tuple <int, int>, Tuple <int, int> > (Tuple.Create(1, 1), Tuple.Create(2, 1)),
                new KeyValuePair <Tuple <int, int>, Tuple <int, int> > (Tuple.Create(3, 1), Tuple.Create(7, 1)),
                new KeyValuePair <Tuple <int, int>, Tuple <int, int> > (Tuple.Create(5, 1), Tuple.Create(13, 1))
            }
            ;

            iwdt.InsertContents(contents);

            asCollection.Clear();

            Assert.AreEqual(0, iwdt.Count);
        }