public void Test_Nesting() { using (var t = new TrackScope()) { ScopeTestHelper.RunNesting(0, t); Assert.IsTrue(t.IsError()); } }
public void Test_Nesting() { try { using (var t = Scope.ForValidation("Test", Scope.WhenError)) { ScopeTestHelper.RunNesting(0, t); } } catch (RuleException ex) { ScopeTestHelper.ShouldBeClean(ex); ScopeTestHelper.ShouldHave(ex, "None1", "Warn1", "Group1", "Group2", "None3"); throw; } }
public void Test() { int nameCounter = 0; int runCounter = 0; Func <string> func = () => (nameCounter++).ToString(); var t = new DelayedScope(func, (func1, level, s) => { func1(); runCounter++; }); Assert.AreEqual(0, nameCounter); ScopeTestHelper.RunNesting(0, t); Assert.AreEqual(1, nameCounter); Assert.AreEqual(6, runCounter); }