简体   繁体   中英

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:

截图

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.

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM