using System; using System.Collections.Generic; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace MsTestRows { public abstract class TestBase { /// /// Derived class implements this method in order to return DATAROW according to rowIndex /// ZERO-based row index. For instance, TestRow_01 sends rowIndex == 0 public abstract DATAROW GetNextDataRow(int rowIndex); /// /// Implement this method in derived class. This method should contain actual test implementation. /// ZERO-based row index. For instance, TestRow_02 sends rowIndex == 1 /// Data from GetNextDataRow() public abstract void TestMethod(DATAROW dataRow, int rowIndex); /// /// This method is called from TestRow_NNN. You don’t need to override it unless you want change some logic. /// ZERO-based row index. For instance, TestRow_100 sends rowIndex == 99 public virtual void TestRowImplementation(int rowIndex) { DATAROW data = GetNextDataRow(rowIndex); TestMethod(data, rowIndex); } } }