CUITe Data Manager

CUITe_DataManager class can be used to read content from XML (the high level schema is fixed - <data> should be the first level, <datarow> second, and under <datarow> you can have any number of tags with values, but no further levels).
  • XML based
  • Multi-level Inheritance (one data set can inherit from another, and so on)
  • Readable, maintainable
Sample code:
Hashtable htData = CUITe_DataManager.GetDataRow(Type.GetType("CUITe_DataMgr.UnitTest1"), "XMLFile1.xml", "tc2");
objProfile.txtFirstName.SetText(htData["firstname"]);
objProfile.txtLastName.SetText(htData["lastname"]);
Sample XML file content (should be an embedded resource, <data> and <datarow> are system tags):
<?xml version="1.0" encoding="utf-8" ?>
<data>
  <datarow id="tc0">
    <nationality>Indian</nationality>
    <lastname>Bala</lastname>
  </datarow>
  <datarow id="tc1" inherits="tc0">
    <firstname>Suresh</firstname>
    <lastname>Balasubramanian</lastname>
    <age>38</age>
    <dob>04/19/1973</dob>
  </datarow>
  <datarow id="tc2" inherits="tc1">
    <test>test</test>
    <address>Kondapur, Hyderabad</address>
    <age>37</age>    
  </datarow>
</data>

Last edited Aug 8, 2011 at 9:48 AM by sureba, version 2

Comments

icnocop Oct 11, 2013 at 8:38 AM 
@BeyMelamed, MsTest has built-in support for this functionality already. See http://msdn.microsoft.com/en-us/library/ms182527.aspx and http://msdn.microsoft.com/en-us/library/ms243192.aspx.

BeyMelamed Jan 22, 2013 at 5:30 PM 
This is great
Can this be abstracted / implemented as spreadsheet or database (odbc) source?