当在 a 中使用 SUTDoFixture
来探索其行为时,对固定方法的第一次调用成功,但在调用 SUT 方法后失败:
public class ConfigurationCharacterization : fitlibrary.DoFixture
{
ConfigurationDelegator cd = new ConfigurationDelegator();
public ConfigurationCharacterization()
{
mySystemUnderTest = cd;
}
public int AmountOfConfigsLoaded()
{
return cd.GetAllConfigs().Count;
}
}
//delegates calls to the static methods of Configuration
public class ConfigurationDelegator : Configuration
{
public new void Clear()
{
Configuration.Clear();
}
public new Configuration GetSingletonByIdentifier(string ident)
{
return Configuration.GetSingletonByIdentifier(ident);
}
public new List<Configuration> GetAllConfigs()
{
return Configuration.GetAllConfigs();
}
}
Runner.exe
,fit.dll
和fixture dll都位于同一个文件夹中。