阅读《Pro Agile .NET Development with Scrum》,在第103页遇到问题。
NUnit运行后出错信息如下:
***** KojackGames.Blackjack.Acc.Tests.Features.GetInvolvedInAGameFeature.MakeABet Given I have navigated to the game play screen to play a hand
-> error: The CurrentThread needs to have it's ApartmentState set to ApartmentState.STA to be able to automate Internet Explorer.
When I click on the bet button
-> skipped because of previous errors
Then I should see the deal button
-> skipped because of previous errors
*****
已经设置了app.config文件,清单如下
<?xml version="1.0" encoding="utf-8" ?>
< configuration>
<configSections>
<sectionGroup name="NUnit">
<section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/>
</sectionGroup>
</configSections>
<NUnit>
<TestRunner>
<!-- Valid values are STA,MTA. Others ignored. -->
<add key="ApartmentState" value="STA" />
</TestRunner>
</NUnit>
< /configuration>
你是英文看不懂,还是看得懂,但是不知道什么意思?
刚才是英文提问,现在修改成用中文提问了。
@liesl: 帮我把这句:The CurrentThread needs to have it's ApartmentState set to ApartmentState.STA to be able to automate Internet Explorer. 翻译成中文。
@Launcher: 这个就是出错信息
@liesl: 能翻译成中文不?英文的我看不懂! The 是啥意思? needs to 是啥意思?
@Launcher: 不知道答案不用继续留言了。
@liesl: 我翻了下 NUnit 的文档,找到了答案,但是因为是英文,你看不懂,我就不贴了。
@Launcher: 你翻不到,因为这个不是NUnit的问题,是WatiN的设置问题。所以你如果有时间,就去学习吧,然后再来帮助别人,而不是闲扯。
@liesl: 这样啊,我看你的配置:
<configSections>
<sectionGroup name="NUnit">
<section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/>
</sectionGroup>
</configSections>
<NUnit>
<TestRunner>
<!-- Valid values are STA,MTA. Others ignored. -->
<add key="ApartmentState" value="STA" />
</TestRunner>
</NUnit>
跟配置 NUnit 是一样的,我以为是 NUnit 呢!