Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public void Test_GetForcePowerDescriptor_ByID_BadResult()
        {
            int intForcePowerDescriptorID = 0;
            ForcePowerDescriptor objForcePowerDescriptor = new ForcePowerDescriptor();

            objForcePowerDescriptor.GetForcePowerDescriptor(intForcePowerDescriptorID);

            Assert.IsNull(objForcePowerDescriptor.ForcePowerDescriptorName);
        }
Esempio n. 3
0
        public void Test_GetForcePowerDescriptor_ByName_BadResult()
        {
            string strForcePowerDescriptorName           = "blah blah";
            ForcePowerDescriptor objForcePowerDescriptor = new ForcePowerDescriptor();

            objForcePowerDescriptor.GetForcePowerDescriptor(strForcePowerDescriptorName);

            Assert.IsNull(objForcePowerDescriptor.ForcePowerDescriptorName);
        }
Esempio n. 4
0
        public void Test_GetForcePowerDescriptor_ByID_GoodResult()
        {
            int intForcePowerDescriptorID = 1;
            ForcePowerDescriptor objForcePowerDescriptor = new ForcePowerDescriptor();

            objForcePowerDescriptor.GetForcePowerDescriptor(intForcePowerDescriptorID);

            Assert.AreEqual(intForcePowerDescriptorID, objForcePowerDescriptor.ForcePowerDescriptorID);
        }
Esempio n. 5
0
        public void Test_GetForcePowerDescriptor_ByName_GoodResult()
        {
            string strForcePowerDescriptorName           = "Telekenitic";
            ForcePowerDescriptor objForcePowerDescriptor = new ForcePowerDescriptor();

            objForcePowerDescriptor.GetForcePowerDescriptor(strForcePowerDescriptorName);

            Assert.AreEqual(strForcePowerDescriptorName, objForcePowerDescriptor.ForcePowerDescriptorName);
        }