Esempio n. 1
0
        public void TestNameValueList()
        {
            BasicNameValueList list = BasicNameValueList.GetBasicNameValueList();

            Assert.AreEqual(10, list.Count, "Items are not caught via fetch");
            Assert.AreEqual("element_2", list.GetItemByKey(2).Value, "NameValue collection fetch failed.");
        }
Esempio n. 2
0
        public void TestNameValueList()
        {
#if SILVERLIGHT
            UnitTestContext context = GetContext();
            DataPortal.ProxyTypeName = typeof(SynchronizedWcfProxy).AssemblyQualifiedName;
            WcfProxy.DefaultUrl      = cslalighttest.Properties.Resources.RemotePortalUrl;
            BasicNameValueList.GetBasicNameValueList((o, e) =>
            {
                if (e.Error != null)
                {
                    context.Assert.Fail(e.Error);
                }
                else
                {
                    context.Assert.AreEqual(10, e.Object.Count, "Items are not caught via fetch");
                    context.Assert.AreEqual("element_2", e.Object.GetItemByKey(2).Value, "NameValue collection fetch failed.");
                }
                context.Assert.Success();
            });
            context.Complete();
#else
            BasicNameValueList list = BasicNameValueList.GetBasicNameValueList();
            Assert.AreEqual(10, list.Count, "Items are not caught via fetch");
            Assert.AreEqual("element_2", list.GetItemByKey(2).Value, "NameValue collection fetch failed.");
#endif
        }