[英]MemberMissingException in FitSharp
When using a SUT in a DoFixture
to explore its behaviour, the first call to a fixture-method succeeds but fails after invoking a SUT-method: 在
DoFixture
使用SUT探索其行为时,对夹具方法的第一次调用成功,但在调用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
and the fixture dll are all located in the same folder. Runner.exe
, fit.dll
和fit.dll
dll都位于同一文件夹中。
As has been pointed out on this github issue , GetSingletonByIdentifier
returns a Configuration
object that gets wrapped in a DoFixture and processes the remainder of the table. 如在此github问题上所指出的,
GetSingletonByIdentifier
返回一个Configuration
对象,该对象包装在DoFixture中并处理表的其余部分。 The next call of Amount of Configs Loaded
then tries to access the corresponding method of the class Configuration
, this doesn't exist, hence the error. 下一次调用“
Amount of Configs Loaded
的配置Amount of Configs Loaded
然后尝试访问Configuration
类的相应方法,该方法不存在,因此发生错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.