Exemple #1
0
        public void Test_EnterDataAndApply()
        {
            // Empty dates
            Assert.AreEqual(fResearchRecord, fDialog.Research);

            var txtName = new TextBoxTester("txtName", fDialog);

            txtName.Enter("sample text");

            var cmbPriority = new ComboBoxTester("cmbPriority", fDialog);

            cmbPriority.Select(1);

            var cmbStatus = new ComboBoxTester("cmbStatus", fDialog);

            cmbStatus.Select(1);

            var nudPercent = new NumericUpDownTester("nudPercent", fDialog);

            nudPercent.EnterValue(11);

            // The links to other records can be added or edited only in MainWinTests
            // (where there is a complete infrastructure of the calls to BaseWin.ModifyX)

            ClickButton("btnAccept", fDialog);

            Assert.AreEqual("sample text", fResearchRecord.ResearchName);
            Assert.AreEqual(GKResearchPriority.rpLow, fResearchRecord.Priority);
            Assert.AreEqual(GKResearchStatus.rsInProgress, fResearchRecord.Status);
            Assert.AreEqual(11, fResearchRecord.Percent);
            Assert.AreEqual("", fResearchRecord.StartDate.StringValue);
            Assert.AreEqual("", fResearchRecord.StopDate.StringValue);
        }
        public static void EnterNumeric(string name, Form form, int value)
        {
            var nud = new NumericUpDownTester(name, form);

            nud.EnterValue(value);
        }
        private TFrmGLCreateLedgerTester()
        {
            TFrmGLCreateLedgerDialog = new TFrmGLCreateLedgerDialog(null);

            nudLedgerNumber = new NumericUpDownTester("nudLedgerNumber", TFrmGLCreateLedgerDialog);

            txtLedgerName = new TextBoxTester("txtLedgerName", TFrmGLCreateLedgerDialog);

            cmbCountryCode = new TCmbAutoPopulatedTester("cmbCountryCode", TFrmGLCreateLedgerDialog);
            cmbBaseCurrency = new TCmbAutoPopulatedTester("cmbBaseCurrency", TFrmGLCreateLedgerDialog);
            cmbIntlCurrency = new TCmbAutoPopulatedTester("cmbIntlCurrency", TFrmGLCreateLedgerDialog);

            // TextBoxTester dtpCalendarStartDate = new TextBoxTester("dtpCalendarStartDate", TFrmGLCreateLedgerDialog);

            nudNumberOfPeriods = new NumericUpDownTester("nudNumberOfPeriods", TFrmGLCreateLedgerDialog);
            nudCurrentPeriod = new NumericUpDownTester("nudCurrentPeriod", TFrmGLCreateLedgerDialog);
            nudNumberOfFwdPostingPeriods = new NumericUpDownTester("nudNumberOfFwdPostingPeriods", TFrmGLCreateLedgerDialog);

            tbbCreate = new ToolStripButtonTester("tbbCreate", TFrmGLCreateLedgerDialog);
        }