本文整理汇总了C#中Chutzpah.Models.ChutzpahTestSettingsFile.InheritFrom方法的典型用法代码示例。如果您正苦于以下问题:C# ChutzpahTestSettingsFile.InheritFrom方法的具体用法?C# ChutzpahTestSettingsFile.InheritFrom怎么用?C# ChutzpahTestSettingsFile.InheritFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chutzpah.Models.ChutzpahTestSettingsFile
的用法示例。
在下文中一共展示了ChutzpahTestSettingsFile.InheritFrom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessInheritance
private void ProcessInheritance(ChutzpahSettingsFileEnvironment environment, ChutzpahTestSettingsFile settings, IDictionary<string, string> chutzpahVariables)
{
if (settings.InheritFromParent || !string.IsNullOrEmpty(settings.InheritFromPath))
{
if (string.IsNullOrEmpty(settings.InheritFromPath))
{
ChutzpahTracer.TraceInformation("Searching for parent Chutzpah.json to inherit from");
settings.InheritFromPath = Path.GetDirectoryName(settings.SettingsFileDirectory);
}
else
{
ChutzpahTracer.TraceInformation("Searching for Chutzpah.json to inherit from at {0}", settings.InheritFromPath);
string settingsToInherit = ExpandVariable(chutzpahVariables, settings.InheritFromPath);
if (settingsToInherit.EndsWith(Constants.SettingsFileName, StringComparison.OrdinalIgnoreCase))
{
settingsToInherit = Path.GetDirectoryName(settingsToInherit);
}
settingsToInherit = ResolveFolderPath(settings, settingsToInherit);
settings.InheritFromPath = settingsToInherit;
}
var parentSettingsFile = FindSettingsFile(settings.InheritFromPath, environment);
if (!parentSettingsFile.IsDefaultSettings)
{
ChutzpahTracer.TraceInformation("Found parent Chutzpah.json in directory {0}", parentSettingsFile.SettingsFileDirectory);
settings.InheritFrom(parentSettingsFile);
}
else
{
ChutzpahTracer.TraceInformation("Could not find a parent Chutzpah.json");
}
}
}