本文整理汇总了C#中TestPackage.AddSetting方法的典型用法代码示例。如果您正苦于以下问题:C# TestPackage.AddSetting方法的具体用法?C# TestPackage.AddSetting怎么用?C# TestPackage.AddSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestPackage
的用法示例。
在下文中一共展示了TestPackage.AddSetting方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeTestPackage
// This is public static for ease of testing
public static TestPackage MakeTestPackage(ConsoleOptions options)
{
TestPackage package = new TestPackage(options.InputFiles);
if (options.ProcessModel != null) //ProcessModel.Default)
package.AddSetting(PackageSettings.ProcessModel, options.ProcessModel);
if (options.DomainUsage != null)
package.AddSetting(PackageSettings.DomainUsage, options.DomainUsage);
if (options.Framework != null)
package.AddSetting(PackageSettings.RuntimeFramework, options.Framework);
if (options.RunAsX86)
package.AddSetting(PackageSettings.RunAsX86, true);
if (options.DisposeRunners)
package.AddSetting(PackageSettings.DisposeRunners, true);
if (options.ShadowCopyFiles)
package.AddSetting(PackageSettings.ShadowCopyFiles, true);
if (options.DefaultTimeout >= 0)
package.AddSetting(PackageSettings.DefaultTimeout, options.DefaultTimeout);
if (options.InternalTraceLevel != null)
package.AddSetting(PackageSettings.InternalTraceLevel, options.InternalTraceLevel);
if (options.ActiveConfig != null)
package.AddSetting(PackageSettings.ActiveConfig, options.ActiveConfig);
if (options.WorkDirectory != null)
package.AddSetting(PackageSettings.WorkDirectory, options.WorkDirectory);
if (options.StopOnError)
package.AddSetting(PackageSettings.StopOnError, true);
if (options.NumWorkers >= 0)
package.AddSetting(PackageSettings.NumberOfTestWorkers, options.NumWorkers);
if (options.RandomSeed > 0)
package.AddSetting(PackageSettings.RandomSeed, options.RandomSeed);
if (options.Verbose)
package.AddSetting("Verbose", true);
#if DEBUG
//foreach (KeyValuePair<string, object> entry in package.Settings)
// if (!(entry.Value is string || entry.Value is int || entry.Value is bool))
// throw new Exception(string.Format("Package setting {0} is not a valid type", entry.Key));
#endif
return package;
}
示例2: MakeTestPackage
// This is public static for ease of testing
public static TestPackage MakeTestPackage(ConsoleOptions options)
{
TestPackage package = new TestPackage(options.InputFiles);
if (options.ProcessModelSpecified)
package.AddSetting(PackageSettings.ProcessModel, options.ProcessModel);
if (options.DomainUsageSpecified)
package.AddSetting(PackageSettings.DomainUsage, options.DomainUsage);
if (options.FrameworkSpecified)
package.AddSetting(PackageSettings.RuntimeFramework, options.Framework);
if (options.RunAsX86)
package.AddSetting(PackageSettings.RunAsX86, true);
if (options.DisposeRunners)
package.AddSetting(PackageSettings.DisposeRunners, true);
if (options.ShadowCopyFiles)
package.AddSetting(PackageSettings.ShadowCopyFiles, true);
if (options.DefaultTimeout >= 0)
package.AddSetting(PackageSettings.DefaultTimeout, options.DefaultTimeout);
if (options.InternalTraceLevelSpecified)
package.AddSetting(PackageSettings.InternalTraceLevel, options.InternalTraceLevel);
if (options.ActiveConfigSpecified)
package.AddSetting(PackageSettings.ActiveConfig, options.ActiveConfig);
// Always add work directory, in case current directory is changed
var workDirectory = options.WorkDirectory ?? Environment.CurrentDirectory;
package.AddSetting(PackageSettings.WorkDirectory, workDirectory);
if (options.StopOnError)
package.AddSetting(PackageSettings.StopOnError, true);
if (options.MaxAgentsSpecified)
package.AddSetting(PackageSettings.MaxAgents, options.MaxAgents);
if (options.NumberOfTestWorkersSpecified)
package.AddSetting(PackageSettings.NumberOfTestWorkers, options.NumberOfTestWorkers);
if (options.RandomSeedSpecified)
package.AddSetting(PackageSettings.RandomSeed, options.RandomSeed);
if (options.DebugTests)
{
package.AddSetting(PackageSettings.DebugTests, true);
if (!options.NumberOfTestWorkersSpecified)
package.AddSetting(PackageSettings.NumberOfTestWorkers, 0);
}
if (options.PauseBeforeRun)
package.AddSetting(PackageSettings.PauseBeforeRun, true);
#if DEBUG
if (options.DebugAgent)
package.AddSetting(PackageSettings.DebugAgent, true);
//foreach (KeyValuePair<string, object> entry in package.Settings)
// if (!(entry.Value is string || entry.Value is int || entry.Value is bool))
// throw new Exception(string.Format("Package setting {0} is not a valid type", entry.Key));
#endif
return package;
}
示例3: CreatePackage
TestPackage CreatePackage (string path)
{
TestPackage package = new TestPackage (path);
package.AddSetting ("ShadowCopyFiles", false);
package.AddSetting ("ProcessModel", "InProcess");
package.AddSetting ("DomainUsage", "Single");
return package;
}
示例4: GetTestPackage
public TestPackage GetTestPackage(string configName)
{
TestPackage package = new TestPackage(ProjectPath);
string appbase = null;
foreach (var name in _configs.Keys)
{
if (configName == null || configName == name)
{
var config = _configs[name];
package.AddSubPackage(new TestPackage(config.AssemblyPath));
appbase = config.OutputDirectory;
break;
}
}
if (appbase != null)
package.AddSetting("BasePath", appbase);
return package;
}
示例5: CorrectRunnerIsUsed
public void CorrectRunnerIsUsed(string files, string processModel, Type expectedType)
{
var package = new TestPackage(files.Split(new char[] { ' ' }));
if (processModel != null)
package.AddSetting("ProcessModel", processModel);
var runner = _factory.MakeTestRunner(package);
Assert.That(runner, Is.TypeOf(expectedType));
}
示例6: CorrectRunnerIsUsed
public void CorrectRunnerIsUsed(string files, string processModel, Type expectedType)
{
var package = new TestPackage(files.Split(new char[] { ' ' }));
if (processModel != null)
package.AddSetting("ProcessModel", processModel);
var runner = _factory.MakeTestRunner(package);
Assert.That(runner, Is.TypeOf(expectedType));
var aggRunner = runner as AggregatingTestRunner;
if (aggRunner != null)
foreach (var childRunner in aggRunner.Runners)
Assert.That(childRunner, Is.TypeOf<TestDomainRunner>());
}
示例7: MakeTestPackage
public static TestPackage MakeTestPackage(HostedOptions options)
{
TestPackage package = new TestPackage(options.InputFiles);
package.AddSetting(PackageSettings.RuntimeFramework, "v4.0");
return package;
}