private ForcePower FillObjectWithForm() { ForcePower ForcePower = new ForcePower(); int ForcePowerID = 0; int ForcePowerDescriptorID = 0; int TurnSegmentID = 0; int.TryParse(this.txtForcePowerID.Text, out ForcePowerID); //int.TryParse(this.cmbForcePowerDescriptorType.SelectedIndex.ToString(), out ForcePowerDescriptorID); if (cmbForcePowerDescriptorType.SelectedText != "") { ForcePowerDescriptor fpd = new ForcePowerDescriptor(); fpd.GetForcePowerDescriptor(cmbForcePowerDescriptorType.SelectedText); ForcePowerDescriptorID = fpd.ForcePowerDescriptorID; } //int.TryParse(this.cmbTurnSegment.SelectedIndex.ToString(), out TurnSegment); if (cmbTurnSegment.SelectedText != "") { TurnSegment ts = new TurnSegment(); ts.GetTurnSegment(cmbTurnSegment.SelectedText); TurnSegmentID = ts.TurnSegmentID; } ForcePower.ForcePowerID = ForcePowerID; ForcePower.ForcePowerDescription = this.txtForcePowerDescription.Text; ForcePower.ForcePowerName = this.txtForcePowerName.Text; ForcePower.TurnSegmentID = TurnSegmentID; //ForcePower.ForcePowerDescriptorID = ForcePowerDescriptorID; return(ForcePower); }
public void Test_GetTurnSegment_ByID_BadResult() { int intTurnSegmentID = 0; TurnSegment objTurnSegment = new TurnSegment(); objTurnSegment.GetTurnSegment(intTurnSegmentID); Assert.IsNull(objTurnSegment.TurnSegmentName); }
public void Test_GetTurnSegment_ByName_BadResult() { string strTurnSegmentName = "blah blah"; TurnSegment objTurnSegment = new TurnSegment(); objTurnSegment.GetTurnSegment(strTurnSegmentName); Assert.IsNull(objTurnSegment.TurnSegmentName); }
public void Test_GetTurnSegment_ByID_GoodResult() { int intTurnSegmentID = 1; TurnSegment objTurnSegment = new TurnSegment(); objTurnSegment.GetTurnSegment(intTurnSegmentID); Assert.AreEqual(intTurnSegmentID, objTurnSegment.TurnSegmentID); }
public void Test_GetTurnSegment_ByName_GoodResult() { string strTurnSegmentName = "Swift"; TurnSegment objTurnSegment = new TurnSegment(); objTurnSegment.GetTurnSegment(strTurnSegmentName); Assert.AreEqual(strTurnSegmentName, objTurnSegment.TurnSegmentName); }