Exemplo n.º 1
0
        public virtual void TestRetrieve()
        {
            NamedArrayList namedArrayList = (NamedArrayList)RetrieveOnlyInstance(typeof(NamedArrayList
                                                                                        ));

            AssertRetrievedOK(namedArrayList);
        }
		private NamedArrayList CreateNamedArrayList()
		{
			NamedArrayList namedArrayList = new NamedArrayList();
			namedArrayList.name = Name;
			for (int i = 0; i < Data.Length; i++)
			{
				namedArrayList.Add(Data[i]);
			}
			return namedArrayList;
		}
Exemplo n.º 3
0
        private NamedArrayList CreateNamedArrayList()
        {
            var namedArrayList = new NamedArrayList();

            namedArrayList.name = Name;
            for (var i = 0; i < Data.Length; i++)
            {
                namedArrayList.Add(Data[i]);
            }
            return(namedArrayList);
        }
		private void AssertRetrievedOK(NamedArrayList namedArrayList)
		{
			Assert.AreEqual(Name, namedArrayList.name);
			object[] listElements = new object[namedArrayList.Count];
			int idx = 0;
			IEnumerator i = namedArrayList.GetEnumerator();
			while (i.MoveNext())
			{
				listElements[idx++] = i.Current;
			}
			ArrayAssert.AreEqual(Data, listElements);
		}
Exemplo n.º 5
0
        public virtual void TestQuery()
        {
            IQuery query = NewQuery(typeof(NamedArrayList));

            query.Descend("name").Constrain(Name);
            IObjectSet objectSet = query.Execute();

            Assert.AreEqual(1, objectSet.Count);
            NamedArrayList namedArrayList = (NamedArrayList)objectSet.Next();

            AssertRetrievedOK(namedArrayList);
        }
Exemplo n.º 6
0
        private void AssertRetrievedOK(NamedArrayList namedArrayList)
        {
            Assert.AreEqual(Name, namedArrayList.name);
            var listElements = new object[namedArrayList.Count];
            var idx          = 0;
            var i            = namedArrayList.GetEnumerator();

            while (i.MoveNext())
            {
                listElements[idx++] = i.Current;
            }
            ArrayAssert.AreEqual(Data, listElements);
        }