Closed michastei closed 3 years ago
Hi Michael According to the documentation (readme.md) only SetUp and TearDown attribute are supported. Since all tests run individually, they are not grouped by class, not possible to call a OneTime method at the right time. I will keep that in mind for a future release. Tobias
Hi Michael. Now OnTimeSetup and OneTimeTearDown are supported. Please have a try.
Hi Tobias, thank you for the implementation. I am sorry for my late reply! I had a try:
[OneTimeSetUp]
public void Init(UIApplication uiApp)
{
UIDocument uiDoc = uiApp.OpenAndActivateDocument("PATH/GOES/HERE");
}
[Test]
public void PassTest()
{
Assert.True(true);
}
[Test]
public void FailTest()
{
Assert.True(false, "This Test should fail!");
}
But the project is not loaded BEFORE the tests. It loads during the same time and the tests will be some kind of ignored. They are not marked red or green afterwards. Do I handle the OneTimeSetup correctly? Best Regards Michael
I want implement unit tests for my Revit plugins. I wrote some basic tests according to the SampleTestProject2 in the repo. Further I tried to implement a OneTimeSetUp, to load a revit project and then execute some tests using this revit project. Unfortunately the OneTimeSetup is never executed. To reproduce, I added
to the RevitTest-Class. But nothing happens.
If i change the lines to
the message box displays two times as expected. But i want the Setup only apply once.
Further I made a Testproject using only Nunit without Revit. There, the OneTimeSetUp works.
Can you help me according this topic? Michael