Skip to content

Configurations

Luiz Henrique Cassettari edited this page Dec 29, 2024 · 9 revisions

NUnit.Version

Force to use Revit version to run the test. Example 2024, 2025...

NUnit.Language

Set language when the Revit process start. Example ENU, PTB... Sample: RevitTest.Language

NUnit.Open

Force to open new Revit process to run tests. Default: false.

NUnit.Close

Force to close Revit process when test finish. Default: false.

NUnit.Timeout

Timeout in minutes. Default: 10.

NUnit.Verbosity

More log for the TestAdapter. Default: 0

  • 0: Minimal Log
  • 1: Normal Log
  • 2: Maximum Log

NUnit.Metadata

Disable metadata configuration.

TestProject

Using AssemblyMetadata

.cs

[assembly: AssemblyMetadata("NUnit.Version", "2024")]
[assembly: AssemblyMetadata("NUnit.Language", "ENU")]
[assembly: AssemblyMetadata("NUnit.Open", "true")]
[assembly: AssemblyMetadata("NUnit.Close", "true")]
[assembly: AssemblyMetadata("NUnit.Verbosity", "1")]
[assembly: AssemblyMetadata("NUnit.Application", "")]

.csproj

<!-- Release -->
<ItemGroup Condition="!$(Configuration.Contains('Debug'))">
  <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
    <_Parameter1>NUnit.Open</_Parameter1>
    <_Parameter2>true</_Parameter2>
  </AssemblyAttribute>
  <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
    <_Parameter1>NUnit.Close</_Parameter1>
    <_Parameter2>true</_Parameter2>
  </AssemblyAttribute>
</ItemGroup>

Using .runsettings

.csproj

<!--.runsettings-->
<PropertyGroup>
  <RunSettingsFilePath>$(MSBuildProjectDirectory)\.runsettings</RunSettingsFilePath>
</PropertyGroup>
<ItemGroup>
  <None Update=".runsettings">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </None>
</ItemGroup>

.runsettings

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
  <NUnit>
    <Version>2024</Version>
    <Language>pt</Language>
    <Open>true</Open>
    <Close>true</Close>
    <Verbosity>1</Verbosity>
    <Application></Application>
    <Metadata>false</Metadata>
  </NUnit>
</RunSettings>

ricaun.RevitTest.TestAdapter

Environment Variables

The ricaun.RevitTest.TestAdapter have this global environment variable that overwrite the others configuration, useful to use in GitHub Actions or other environment to overwrite the TestProject configuration.

RICAUN_REVITTEST_TESTADAPTER_NUNIT_VERSION
RICAUN_REVITTEST_TESTADAPTER_NUNIT_LANGUAGE
RICAUN_REVITTEST_TESTADAPTER_NUNIT_OPEN
RICAUN_REVITTEST_TESTADAPTER_NUNIT_CLOSE
RICAUN_REVITTEST_TESTADAPTER_NUNIT_TIMEOUT
RICAUN_REVITTEST_TESTADAPTER_NUNIT_VERBOSITY
RICAUN_REVITTEST_TESTADAPTER_NUNIT_APPLICATION
RICAUN_REVITTEST_TESTADAPTER_NUNIT_METADATA