/// <summary> /// /// </summary> public override void Execute() { Type type = ModelType.GetCurrentType(); if (type == null) { throw new InvalidOperationException("The type " + ModelType.ToString() + " cannot be found."); } Type modelType = type; object modelObject = Activator.CreateInstance(modelType); if (!(modelObject is Model)) { throw new InvalidOperationException("ModelType (" + modelType.FullName + ") is not a subclass of " + typeof(Model).FullName); } XtcTestCaseLoader xtcLoader = new XtcTestCaseLoader(_content); xtcLoader.AddModel((Model)modelObject); if (_asynchronousModel) { xtcLoader.RunAsync(true); } else { xtcLoader.Run(); } }
private TestResult RunLoader() { if (firstCase == -1 && lastCase == -1) { // Run all test cases in this xtc file loader = new XtcTestCaseLoader(xtcFileName); } else { loader = new XtcTestCaseLoader(xtcFileName, firstCase, lastCase); } loader.AddModel(this); loader.ShouldCreateTestLogs = false; if (loader.Run()) { return(TestResult.Pass); } return(TestResult.Fail); }