Beispiel #1
0
        public void UpdateDataTest()
        {
            string      path = Constants.AF_TABLE_PATH;
            PITableData data = new PITableData();

            data.Columns = new Dictionary <string, string>();
            data.Columns.Add("Model", "String");
            data.Columns.Add("4WD", "Boolean");
            data.Columns.Add("TopSpeed", "Int32");
            data.Rows = new List <Dictionary <string, object> >();
            var item1 = new Dictionary <string, object>();

            item1.Add("Model", "Jeep");
            item1.Add("4WD", true);
            item1.Add("TopSpeed", 100);
            var item2 = new Dictionary <string, object>();

            item2.Add("Model", "Prius");
            item2.Add("4WD", false);
            item2.Add("TopSpeed", 80);
            data.Rows.Add(item1);
            data.Rows.Add(item2);
            instance.UpdateData(webId, data);

            StandardPISystem.Refresh();
            AFTable myTable = AFObject.FindObject(path) as AFTable;

            myTable.Refresh();

            Assert.IsTrue(myTable.Table.Rows.Count == 2);
            Assert.IsTrue(myTable.Table.Columns.Count == 3);
        }
Beispiel #2
0
        public void UpdateTest()
        {
            string  path  = Constants.AF_TABLE_PATH;
            PITable table = instance.GetByPath(path, null);

            table.Id          = null;
            table.Description = "New table description";
            table.Links       = null;
            table.Path        = null;
            table.WebId       = null;
            instance.Update(webId, table);

            StandardPISystem.Refresh();
            AFTable myTable = AFObject.FindObject(path) as AFTable;

            myTable.Refresh();

            if (myTable != null)
            {
                Assert.IsTrue(myTable.Description == table.Description);
            }
        }