我正在尝试将套件配置文件与 FitSharp 一起使用。我使用的是此页面布局的确切格式,但是,每次我尝试访问它时,都会收到以下错误:
fitSharp.Machine.Exception.TypeMissingException: Type 'AppDomainSetup' not found in assemblies:
file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
file:///C:/Apps/FitSharp/4.0/Runner.exe
file:///C:/Apps/FitSharp/4.0/fitSharp.DLL
file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
at fitSharp.Machine.Engine.ApplicationUnderTest.FindType(NameMatcher typeName)
at fitSharp.Machine.Engine.TypeDictionary.GetItem(String typeName)
at fitSharp.Machine.Application.SuiteConfiguration.LoadNode(String typeName, XmlNode methodNode)
at fitSharp.Machine.Application.SuiteConfiguration.LoadXml(String configurationXml)
at fitSharp.Machine.Application.ArgumentParser.InvokeArgumentHandler(String switch, String argumentValue)
at fitSharp.Machine.Application.ArgumentParser.Parse(IList`1 commandLineArguments)
at fitSharp.Machine.Application.Shell.Run(IList`1 commandLineArguments)
看来 AppDomainSetup 不是套件配置的有效标记,但由于在该示例中使用了它,因此不可能。
到底是怎么回事?我将如何纠正这个问题?我的最终目标是为测试装置使用两个配置文件。我需要同时使用 App.config 和 wse3policyCache.config。
这是我的套件配置
<suiteConfig>
<AppDomainSetup>
<ApplicationBase>App</ApplicationBase>
<ConfigurationFile>D:\Projects\pathto\myproject\app.config</ConfigurationFile>
</AppDomainSetup>
<ApplicationUnderTest>
<AddAssembly>D:\Projects\pathto\myproject\bin\Debug\myproject.dll</AddAssembly>
<AddNamespace>myproject.Namespace</AddNamespace>
</ApplicationUnderTest>
<Culture>
<Name>en-AU</Name>
</Culture>
<Settings>
<Runner>fitSharp.Slim.Service.Runner</Runner>
</Settings>
<FileExclusions>
</FileExclusions>
<Slim.Operators>
</Slim.Operators>
<Fit.Operators>
<Add>my.Custom.Handler</Add>
<Remove>fit.Operators.ExecuteError</Remove>
</Fit.Operators>
</suiteConfig>
这是我正在使用的 Fitnesse 测试页面的开头
!define TEST_SYSTEM {slim}
!define COMMAND_PATTERN {%m -c suite.config %p}
!define TEST_RUNNER {C:\Apps\FitSharp\4.0\Runner.exe}
!path D:\Projects\pathto\myproject\bin\Debug\myproject.dll
!define COLLAPSE_SETUP {true}
!define COLLAPSE_TEARDOWN {true}