Odin Technology - Automated Software Testing

Axe Test Automation Platform

General discussion relating to the Axe Test Automation Platform from Odin Technology

Posts by Odin employees marked:

Unit testing Custom Action - how to mock ITest

Hi, I am trying to write unit test for my custom action and I am struggling to create valid/mocked ITest(Test) instance. What properties need to be set ?

 [TestMethod]
        public void TestCustomAction()
        {
            var axeTest = new Test();
            MyCustomActions.TestIt(axeTest, "file.xls");
      }


public static int TestIt(ITest axe, string downloadAsFileName)
{
  axe.StepInfo("Log stuff");
  axe.TestAbort(); // here it fails with following exception : Value cannot be null. Parameter name: fileName
}
Vojtech Mares Send private email
Friday, October 4, 2013
 
 
Hi Vojtech,

Calls to StepInfo and TestAbort both need to be made in the context of an initialised running test since they write to the test results files. So adding a call to TestBegin should solve the problem. This will need to reference a valid results.xml in the correct Axe project structure.

Sam
Sam Warwick Send private email
Tuesday, October 8, 2013
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics