public InvalidData() { tfw = new TestFramework(); time.Sec = 0; time.NanoSec = 0; }
public TestResult Execute(TestFramework fw) { TestItem item; TestResult result = null; TestResult itemResult; bool proceed = true; int i; this.testFramework = fw; for (i = 0; i < preItems.Count && proceed; i++) { item = (TestItem)preItems[i]; fw.TestItem(item.title); try { itemResult = item.Run(this); fw.ItemComposeVerdict(itemResult.ExpectedVerdict, itemResult.Verdict); proceed = item.MayProceed(itemResult); } catch (System.Exception exc) { fw.TestMessage(TestMessage.Error, GetExceptionReport(exc)); itemResult = new TestResult("UNKNOWN", exc.Message, TestVerdict .Pass, TestVerdict.Fail); fw.ItemComposeVerdict(itemResult.ExpectedVerdict, itemResult.Verdict); proceed = false; } } while (i < preItems.Count) { item = (TestItem)preItems[i]; fw.TestItem(item.title); fw.ItemComposeVerdict(TestVerdict.Unresolved, TestVerdict .Unresolved); i++; } if (proceed) { try { result = this.Run(); } catch (System.Exception exc) { fw.TestMessage(TestMessage.Error, GetExceptionReport(exc)); result = new TestResult("UNKNOWN", exc.Message, TestVerdict.Pass, TestVerdict.Fail); } } else { result = new TestResult("Test succeeded", "Test could not be initialized", TestVerdict.Unresolved, TestVerdict.Unresolved); } proceed = true; for (i = 0; i < postItems.Count && proceed; i++) { item = (TestItem)postItems[i]; fw.TestItem(item.title); try { itemResult = item.Run(this); fw.ItemComposeVerdict(itemResult.ExpectedVerdict, itemResult.Verdict); proceed = item.MayProceed(itemResult); } catch (System.Exception exc) { fw.TestMessage(TestMessage.Error, GetExceptionReport(exc)); itemResult = new TestResult("UNKNOWN", exc.Message, TestVerdict.Pass, TestVerdict.Fail); fw.ItemComposeVerdict(itemResult.ExpectedVerdict, itemResult.Verdict); proceed = false; } } if (i < postItems.Count) { result.Verdict = TestVerdict.Unresolved; } while (i < postItems.Count) { item = (TestItem)postItems[i]; fw.TestItem(item.title); fw.ItemComposeVerdict(TestVerdict.Unresolved, TestVerdict.Unresolved); i++; } return result; }
public SampleInfo1() { tfw = new TestFramework(); }