public bool AddDataToSuite(TestSuiteData dataToAdd) { bool addResult = false; if (dataToAdd.IsValid) { if ((!dataToAdd.SuiteName.Equals(string.Empty)) && (!dataToAdd.SuiteName.Equals(Name))) { name = dataToAdd.SuiteName; } if ((!dataToAdd.SuiteName.Equals(string.Empty)) && (!dataToAdd.SuiteDescription.Equals(Description))) { description = dataToAdd.SuiteDescription; } if (dataToAdd.BatteryID > -1) { if (batteries.ContainsKey(dataToAdd.BatteryID)) { TestBattery currentBattery = null; if (batteries.TryGetValue(dataToAdd.BatteryID, out currentBattery)) { currentBattery.AddDataToBattery(dataToAdd); } else { TestBattery newBattery = new TestBattery(this, dataToAdd.BatteryID); newBattery.AddDataToBattery(dataToAdd); batteries.Add(dataToAdd.BatteryID, newBattery); } } } } else { addResult = false; ErrorBase newError = new ErrorBase(); newError.Name = "dataToAdd.IsValid was FALSE"; HandleError(newError); } return addResult; }
public TestCase(TestBattery parentPassed, int idPassed) : this() { parent = parentPassed; id = idPassed; }