当前位置: 首页>>代码示例>>C#>>正文


C# TestPackage.Validate方法代码示例

本文整理汇总了C#中TestPackage.Validate方法的典型用法代码示例。如果您正苦于以下问题:C# TestPackage.Validate方法的具体用法?C# TestPackage.Validate怎么用?C# TestPackage.Validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestPackage的用法示例。


在下文中一共展示了TestPackage.Validate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        /// <summary>
        /// NBench Runner takes the following <see cref="args"/>
        /// 
        /// C:\> NBench.Runner.exe [assembly name] [output-directory={dir-path}] [configuration={file-path}] [include=MyTest*.Perf*,Other*Spec] [exclude=*Long*] [concurrent={true|false}] [trace={true|false}] [teamcity={true|false}]
        /// 
        /// </summary>
        /// <param name="args">The commandline arguments</param>
        static int Main(string[] args)
        {
            string[] include = null;
            string[] exclude = null;
            bool concurrent = false;
            bool trace = false;
            bool teamcity = false;
            if (CommandLine.HasProperty("include"))
                include = CommandLine.GetProperty("include").Split(',');
            if (CommandLine.HasProperty("exclude"))
                exclude = CommandLine.GetProperty("exclude").Split(',');
            if (CommandLine.HasProperty("concurrent"))
                concurrent = CommandLine.GetBool("concurrent");
            if (CommandLine.HasProperty("trace"))
                trace = CommandLine.GetBool("trace");
            if (CommandLine.HasProperty("teamcity"))
                teamcity = CommandLine.GetBool("teamcity");
            else
            {
                // try to auto-detect if not explicitly set
                teamcity = !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("TEAMCITY_PROJECT_NAME"));
            }

            TestPackage package = new TestPackage(CommandLine.GetFiles(args), include, exclude, concurrent) {Tracing = trace};

            if (CommandLine.HasProperty("output-directory"))
                package.OutputDirectory = CommandLine.GetProperty("output-directory");

            if (CommandLine.HasProperty("configuration"))
                package.ConfigurationFile = CommandLine.GetProperty("configuration");

            package.TeamCity = teamcity;

            package.Validate();
            var result = TestRunner.Run(package);

            return result.AllTestsPassed ? 0 : -1;
        }
开发者ID:petabridge,项目名称:NBench,代码行数:45,代码来源:Program.cs

示例2: LoadPackage

private static TestPackage LoadPackage(IEnumerable<string> include = null, IEnumerable<string> exclude = null)
{
    #if DEBUG
    var package = new TestPackage(".." + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + "NBench.Tests.Assembly" + Path.DirectorySeparatorChar + "bin" + Path.DirectorySeparatorChar + "Debug" + Path.DirectorySeparatorChar + "NBench.Tests.Assembly.dll", include, exclude);
    #else
            var package = new TestPackage(".."+ Path.DirectorySeparatorChar +".."+ Path.DirectorySeparatorChar +".."+ Path.DirectorySeparatorChar +"NBench.Tests.Assembly"+ Path.DirectorySeparatorChar +"bin"+ Path.DirectorySeparatorChar +"Release"+ Path.DirectorySeparatorChar +"NBench.Tests.Assembly.dll", include, exclude);
    #endif

            package.Validate();
            return package;
}
开发者ID:petabridge,项目名称:NBench,代码行数:11,代码来源:NBenchIntregrationTest.cs


注:本文中的TestPackage.Validate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。