SeanVDH
SeanVDH

Reputation: 916

NUnit Test Not Storing or Using Variable

Original code is as follows:

 [Test]
 public void TestCsvReader()
 {
     CustomUploadModel model = new CustomUploadModel();
     DataTable dt = (DataTable)PrivateTester.RunInstanceMethod(typeof (CustomUploadModel), "ParseCSV", model, new object[] {m_testFilesPath + FxTest, ',', 1});
 }

When I check my locals, the DataTable doesn't exist. I've also tried instantiating with DataTable dt = new DataTable, but the table still doesn't exist. I've checked RunInstanceMethod and it's working fine. Any ideas as to what causes this?

Upvotes: 1

Views: 129

Answers (1)

Joe White
Joe White

Reputation: 97676

Sounds like the compiler is optimizing away your variable.

Upvotes: 1

Related Questions