1

Summary:

When I use NUnit3 TestCaseAttribute to parametrize LeanFT tests, TestTearDown() throws this exception: System.InvalidCastException: 'The of object of type "HP.LFT.Report.RunUnitVerificationNode" cannot be converted to type "HP.LFT.Report.IReportStructureEventArgs".'

Background:

I have created a fresh clean project from the LeanFT Nunit 3 Project template which comes with the nice UnitTestClassBase class. This class comes with this method causing the exception:

[TearDown]
public void BasicTearDown()
{
    TestTearDown(); //exception is thrown here
}

Code example:

[Test]
[TestCase(5,5)]
public void FiveEqualsFive_TestCase_throwsException(int number, int number2)
{
    Verify.AreEqual(number, number);
}

[Test]
public void FiveEqualsFive_WorksFine()
{
    Verify.AreEqual(5, 5);
}

The same happens with TestCaseSourceAttribute. I assume there is some issue generating the LeanFT report. Shouldn't it be possible to use the attribute with LeanFT?

tomwaitforitmy
  • 509
  • 3
  • 16
  • is the setup performed? For teardown to work, the setup needs to be done properly. Can you provide a minimal code for us to reproduce? – Adelin Jul 11 '19 at 07:25
  • Yes, Setup() is performed. Just do this: "New project -> LeanFT NUnit 3 Project"; install nuget packages; add the FiveEqualsFive_TestCase_throwsException test to the code; start debugging. My setup: VS 2017, Win 10, Lean FT 14.52, .Net Framework 4.6.1, NUnit 3.12, NUnit3TestAdapter 3.13. – tomwaitforitmy Jul 11 '19 at 08:56

0 Answers0