Esempio n. 1
0
        public void TestNameValueList()
        {
            NameValueListObj nvList = NameValueListObj.GetNameValueListObj();

            Assert.AreEqual("Fetched", Csla.ApplicationContext.GlobalContext["NameValueListObj"]);

            Assert.AreEqual("element_1", nvList[1].Value);

            //won't work, because IsReadOnly is set to true after object is populated in the for
            //loop in DataPortal_Fetch
            //NameValueListObj.NameValuePair newPair = new NameValueListObj.NameValuePair(45, "something");

            //nvList.Add(newPair);

            //Assert.AreEqual("something", nvList[45].Value);
        }
Esempio n. 2
0
        public void TestNameValueList()
        {
            IDataPortal <NameValueListObj> dataPortal = _testDIContext.CreateDataPortal <NameValueListObj>();

            NameValueListObj nvList = dataPortal.Fetch();

            Assert.AreEqual("Fetched", TestResults.GetResult("NameValueListObj"));

            Assert.AreEqual("element_1", nvList[1].Value);

            //won't work, because IsReadOnly is set to true after object is populated in the for
            //loop in DataPortal_Fetch
            //NameValueListObj.NameValuePair newPair = new NameValueListObj.NameValuePair(45, "something");

            //nvList.Add(newPair);

            //Assert.AreEqual("something", nvList[45].Value);
        }
Esempio n. 3
0
        public void TestNameValueList()
        {
            TestResults.Reinitialise();

            NameValueListObj nvList = GetNameValueListObjInstance();

            Assert.AreEqual("Fetched", TestResults.GetResult("NameValueListObj"));

            Assert.AreEqual("element_1", nvList[1].Value);

            //won't work, because IsReadOnly is set to true after object is populated in the for
            //loop in DataPortal_Fetch
            //NameValueListObj.NameValuePair newPair = new NameValueListObj.NameValuePair(45, "something");

            //nvList.Add(newPair);

            //Assert.AreEqual("something", nvList[45].Value);
        }