public RunChained ( string description, string sucessMessage, Func |
||
description | string | |
sucessMessage | string | |
func | Func |
|
return | void |
// // GET: /System/ public virtual ActionResult Index() { var runner = new TaskRunner(); runner.RunChained("Can access business server", "Success", x => Simply.Do.Resolve<ISystemService>().Check()); return View(runner.Results); }
public void TestRunChainedWithSuccess() { TaskRunner runner = new TaskRunner(); runner.RunChained("Test0", "OK!!!", x => { TaskRunner runner2 = new TaskRunner(); runner.Run("Test1", "OK", y => y.FailUnless(2 + 2 == 4, "Erro")); runner.Run("Test2", "OK", y => y.FailUnless(true, "Erro")); runner.Run("Test3", "OK", y => y.FailUnless(!false, "Erro")); return runner2.Results; }); runner.Results.Count(x => x.ResultType == TaskRunner.Result.Type.Success).Should().Be(4); runner.Results.Count(x => x.ResultTypeTag == "success").Should().Be(4); runner.Results.Count(x => x.Message == "OK").Should().Be(3); runner.Results.Count(x => x.Message == "OK!!!").Should().Be(1); runner.Results.Count().Should().Be(4); runner.Results.Count(x => x.Description == "Test0").Should().Be(1); runner.Results.Count(x => x.Description == "Test1").Should().Be(1); runner.Results.Count(x => x.Description == "Test2").Should().Be(1); runner.Results.Count(x => x.Description == "Test3").Should().Be(1); }