0

I know that there is a way for me to pull data out of the NUnit compiler but cannot find the web URLs with the documentation. Essentially it was how to setup a class with getter setters to pull NUnit time run, assert results, name, literally anything I want.

Not sure even if this route would be viable anymore because I am not using SpecRun with NUnit.

My Goal:

  • Trying to have a scenario run,
  • before it would log when it starts, the name of the scenario and what feature it is in.
  • Once finished it would also grab finish time and the result of test case

Once it hits teardown, it would store all this information into a JSON object that I can send off to a DB somewhere to play with however I please.

l3l00
  • 55
  • 1
  • 7

1 Answers1

1

You can use TestContext/ScenarioContext/FeatureInfo/ScenarioInfo classes to pull information about features and tests at run time. You can capture the start and finish times yourself in the setup and tear down methods.

Xena
  • 378
  • 2
  • 12
  • I was able to get up to the ScenarioContext and it is apparently utilizing Dictionaries: KeyValuePair When I peek into it, looks like the kvp is String, Object – l3l00 May 08 '16 at 19:13
  • So when I get to ScenarioContext, looks like there is using Dictionary realizing what I think you mean, inside the BeforeScenario, AfterFeature, etc. I would create like a public List Use Stopwatch for the time and have it EndOfTestRun take the list and place it in a JSON object and serialize it? – l3l00 May 08 '16 at 19:24