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


C# Runner.Execute方法代码示例

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


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

示例1: CanGoToFavourites

 public void CanGoToFavourites()
 {
     using (var runner = new Runner<FavouritesTask>())
     {
         runner.Execute();
     }
 }
开发者ID:kamukondiwa,项目名称:SeleniumRunner,代码行数:7,代码来源:RunnerTests.cs

示例2: Execute

        public override bool Execute()
        {
            var stopwatch = Stopwatch.StartNew();
            BuildEngine.LogMessageEvent(new BuildMessageEventArgs(string.Format("Pepita (version {0}) Executing", GetType().Assembly.GetName().Version), "", "Pepita", MessageImportance.High));

            try
            {
                GetProjectPath(Console.Out);

                var runner = new Runner
                                 {
                                     ProjectDirectory = ProjectDirectory,
                                     SolutionDirectory = SolutionDirectory,
                                     WriteInfo = s => BuildEngine.LogMessageEvent(new BuildMessageEventArgs("\t" + s, "", "Pepita", MessageImportance.High)),
                                 };
                runner.Execute();
            }
            catch (ExpectedException expectedException)
            {
                BuildEngine.LogErrorEvent(new BuildErrorEventArgs("", "", "", 0, 0, 0, 0, string.Format("Pepita: {0}", expectedException.Message), "", "Pepita"));
                return false;
            }
            catch (Exception exception)
            {
                BuildEngine.LogErrorEvent(new BuildErrorEventArgs("", "", "", 0, 0, 0, 0, string.Format("Pepita: {0}", exception), "", "Pepita"));
                return false;
            }
            finally
            {
                stopwatch.Stop();
                BuildEngine.LogMessageEvent(new BuildMessageEventArgs(string.Format("\tFinished ({0}ms)", stopwatch.ElapsedMilliseconds), "", "Pepita", MessageImportance.High));
            }
            return true;
        }
开发者ID:irium,项目名称:Pepita,代码行数:34,代码来源:RestorePackagesTask.cs

示例3: Execute

        public void Execute()
        {
            var packagePath = Path.Combine(Environment.CurrentDirectory, "NugetPackageFiles");
            packagePath = Path.GetFullPath(packagePath);
            var runner = new Runner
                             {
                                 PackageDirectory = packagePath,
                                 MetadataAssembly="Standard.dll",
                                 WriteInfo = s => Debug.WriteLine(s)
                             };
            runner.Execute();

            var outputFile = Path.Combine(packagePath, "MyPackage.1.0.nupkg");
            var expectedFIle = Path.Combine(Environment.CurrentDirectory, "MyPackage.1.0.nupkg ");

            using (var package1 = Package.Open(expectedFIle))
            using (var package2 = Package.Open(outputFile))
            {
                foreach (var part1 in package1.GetParts())
                {
                    if (part1.Uri.OriginalString.EndsWith("psmdcp"))
                    {
                        continue;
                    }
                    if (part1.Uri.OriginalString.EndsWith("rels"))
                    {
                        continue;
                    }
                    var part2 = package2.GetPart(part1.Uri);
                    var hash1 = GetFileHash(part1);
                    var hash2 = GetFileHash(part2);
                    Assert.AreEqual(hash1,hash2, part1.Uri.OriginalString);
                }
            }
        }
开发者ID:irium,项目名称:Pepita,代码行数:35,代码来源:IntegrationTests.cs

示例4: Execute

        public override bool Execute()
        {
            var stopwatch = Stopwatch.StartNew();
            BuildEngine.LogMessageEvent(new BuildMessageEventArgs(string.Format("PepitaPackage (version {0}) Executing", GetType().Assembly.GetName().Version), "", "Pepita", MessageImportance.High));
            try
            {
                ValidatePackageDir();
                var runner = new Runner
                    {
                        PackageDirectory = NuGetBuildDirectory,
                        MetadataAssembly = MetadataAssembly,
                        Version = Version,
                        TargetDir = TargetDir,
                        WriteInfo = s => BuildEngine.LogMessageEvent(new BuildMessageEventArgs("\t" + s, "", "Pepita", MessageImportance.High)),
                    };
                    runner.Execute();
            }
            catch (ExpectedException expectedException)
            {
                BuildEngine.LogErrorEvent(new BuildErrorEventArgs("", "", "", 0, 0, 0, 0, string.Format("Pepita: {0}", expectedException.Message), "", "Pepita"));
                return false;
            }
            catch (Exception exception)
            {
                BuildEngine.LogErrorEvent(new BuildErrorEventArgs("", "", "", 0, 0, 0, 0, string.Format("Pepita: {0}", exception), "", "Pepita"));
                return false;
            }
            finally
            {
                stopwatch.Stop();
                BuildEngine.LogMessageEvent(new BuildMessageEventArgs(string.Format("\tFinished ({0}ms)", stopwatch.ElapsedMilliseconds), "", "Pepita", MessageImportance.High));
            }

            return true;
        }
开发者ID:SimonCropp,项目名称:Pepita,代码行数:35,代码来源:CreatePackageTask.cs

示例5: BackgroundDoWork

 private void BackgroundDoWork(object sender, DoWorkEventArgs e)
 {
     var rdr = (DatabaseReader)e.Argument;
     var runner = new Runner(rdr, _filePath, OriginSqlType(), SqlServerCE4Radio.Checked);
     //pass thru the event to background worker
     runner.ProgressChanged += (s1, e1) => backgroundWorker1.ReportProgress(e1.ProgressPercentage, e1.UserState);
     var result = runner.Execute();
     if (!result) e.Result = runner.LastErrorMessage;
     else e.Result = null;
     rdr.Dispose();
 }
开发者ID:roadrunner75,项目名称:dbschemareader,代码行数:11,代码来源:CopyForm.cs

示例6: Execute

        public void Execute(Runner my)
        {
            var prop = typeof(TestClass).GetProperty("TestProperty");
            var obj = new TestClass();

            my.Execute("raw", i =>
            {
                obj.TestProperty = "asd";
            });

            var stdDel = (Action<TestClass, string>)Delegate.CreateDelegate(typeof(Action<TestClass, string>), prop.GetSetMethod());
            my.Execute("stddel", i =>
            {
                stdDel(obj, "asd");
            });

            var genDel = new MethodCache().GetSetter(prop);
            my.Execute("gendel", i =>
            {
                genDel(obj, "asd");
            });

            var cache = new MethodCache();
            var method = prop.GetSetMethod();
            cache.GetInvoker(method);
            my.Execute("gendelc", i =>
            {
                cache.GetInvoker(method)(obj, "asd");
            });

            my.Execute("gendelc2", i =>
            {
                cache.GetSetter(prop)(obj, "asd");
            });

            my.Execute("invoke", i =>
            {
                method.Invoke(obj, new[] { "asd" });
            });

            my.Execute("setvalue", i =>
            {
                prop.SetValue(obj, "asd", null);
            });

            var settable = prop.ToSettable();
            my.Execute("settable", i =>
            {
                settable.Set(obj, "asd");
            });
        }
开发者ID:juanplopes,项目名称:simple-commons,代码行数:51,代码来源:PropertyWrapper.cs

示例7: Execute

    public void Execute()
    {
        var packagePath = Path.Combine(Environment.CurrentDirectory, "NugetPackageFiles");
        packagePath = Path.GetFullPath(packagePath);
        var runner = new Runner
            {
                PackageDirectory = packagePath,
                MetadataAssembly = "Standard.dll",
                WriteInfo = s => Debug.WriteLine(s)
            };
        runner.Execute();

        var outputFile = Path.Combine(packagePath, "Standard.1.0.0.0.nupkg");
        var expectedFile = Path.Combine(Environment.CurrentDirectory, "MyPackage.1.0.0.0.nupkg ");

        VerifyPackagesAreTheSame(expectedFile, outputFile);
    }
开发者ID:SimonCropp,项目名称:Pepita,代码行数:17,代码来源:IntegrationTests.cs

示例8: Execute

 public bool Execute()
 {
     var runner = new Runner(new MSBuildLogWriter(BuildEngine), new MSBuildParameterParser());
     return runner.Execute(new[] {TargetDirectory, Variables ?? string.Empty});
 }
开发者ID:davetayls,项目名称:rivet,代码行数:5,代码来源:Rivet.cs

示例9: Main

 public static int Main(string[] args)
 {
     _runner = new Runner(new ConsoleLogWriter(), new ConsoleParameterParser());
     return _runner.Execute(args) ? 0 : 1;
 }
开发者ID:davetayls,项目名称:rivet,代码行数:5,代码来源:Program.cs


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