internal static bool AddTestCase(
string testCaseName,
string testCaseId,
string testCaseDescription,
string testSuiteName,
string testSuiteId,
string testScenarioName,
string testScenarioId,
Guid testPlatformId,
// 20141211
// ScriptBlock[] testCode)
ICodeBlock[] testCode)
{
bool result = false;
var testSuite =
GetTestSuite(
testSuiteName,
testSuiteId,
testPlatformId) ?? CurrentTestSuite;
/*
if (null == testSuite) { // ?? mistaken behavior ??
testSuite = TestData.CurrentTestSuite;
}
*/
//var testScenario =
// GetTestScenario(
// testSuite,
// testScenarioName,
// testScenarioId,
// testSuiteName,
// testSuiteId,
// testPlatformId);
//if (null == testScenario) { // ?? mistaken behavior ??
// testScenario = CurrentTestScenario;
//}
var testScenario =
GetTestScenario(
testSuite,
testScenarioName,
testScenarioId,
testSuiteName,
testSuiteId,
testPlatformId) ?? CurrentTestScenario;
//var testCase =
// new TestCase(
// testCaseName,
// testCaseId);
//testCase.Description = testCaseDescription;
//testCase.TestCode = testCode;
var testCase =
new TestCase(
testCaseName,
testCaseId)
{
Description = testCaseDescription,
TestCode = testCode
};
CurrentTestCase = testCase;
try {
testScenario.TestCases.Add(testCase);
result = true;
}
catch (Exception eFailedToAdd) {
throw eFailedToAdd;
//result = false;
}
return result;
}