【发布时间】:2016-01-31 16:16:25
【问题描述】:
我遇到了一个问题,即在 NCrunch 下测试变得不稳定。看起来它与一些影子复制问题有关。我的测试是这样的
class SaveViewSettings : ISaveSettings
{
public void SaveSettings()
{
Properties.View.Default.Save();
}
}
[TestFixture]
// ReSharper disable once InconsistentNaming
class SaveViewSettings_Should
{
[Test]
public void Save_Settings()
{
var ctx = Properties.View.Default;
var sut = new SaveViewSettings();
ctx.LeftSplitter = 12.34;
sut.SaveSettings();
ctx.Reload();
ctx.LeftSplitter.Should().Be(12.34);
}
}
当使用ctx.Reload() 重新加载设置时,我明白了
System.Configuration.ConfigurationErrorsException : ...
----> System.Configuration.ConfigurationErrorsException...
(C:\...\AppData\Local\Remco_Software_Ltd\nCrunch.TestRunner.AppDom_Url_q2piuozo0uftcc2pz5zv15hpilzfpoqk\[version]\user.config...)
大约 3 个月前在 NCrunch 论坛上提出了类似的问题:Unrecognized configuration section userSettings
【问题讨论】: