I am trying to run some test with different values each time. For example: I have 3 methods: `methodA`, `methodB`, and `methodC`. I want to run each method twice with a different Index location. I have `TestInitialize` and `ClassInitialize` methods.

1. I tried using `ClassInitialize` but I wasn't successful; I am getting compile time error because my test context is not static. 

```
public TestContext TestContext
{
   get { return testContextInstance; }
   set { testContextInstance = value; }
}

[DeploymentItem("UI.Framework.IntegrationTests\\ExpectedValues.xml")]
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML", "|DataDirectory|\\ExpectedValues.xml", "searchTerm2", DataAccessMethod.Sequential)]
[ClassInitialize()]
publicstaticvoid ClassInitialize(TestContext context)
{        
   string indexPath = TestContext.DataRow[0].ToString();
   bool isSuccess1 = SearchApiTestsHelper.InitializeSearchEngine(indexPath, null);
   Assert.IsTrue(isSuccess1);
}

```

I couldn't do this.
2. I tried using `TestInitialize` but the data row was not being loaded, it was `null`.

```
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML",
            "|DataDirectory|\\ExpectedValues.xml", 
            "indices", 
            DataAccessMethod.Sequential),
TestInitialize()]
public void MyTestInitialize()
{
    string indexPath = TestContext.DataRow[0].ToString();
    bool isSuccess1 = SearchApiTestsHelper.InitializeSearchEngine(indexPath, null);
    Assert.IsTrue(isSuccess1);
}

```
3. I know I can set each method to run twice however, some methods require different data for validation. e.g `method2` still needs to run twice for each index location and for each run assert a set of expected values from the data source.

```
[DeploymentItem("UI.Framework.IntegrationTests\\ExpectedValues.xml")]
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML",
            "|DataDirectory|\\ExpectedValues.xml", 
            "pb1", DataAccessMethod.Sequential),
 TestCategory("Integration")]
[TestMethod]
public void PhraseBoosting()
{
    expectedVal = TestContext.DataRow[0].ToString();
}

```

How can this be archived?