예제 #1
0
        public void ExchangeRateUsage()
        {
            FMainDS.LoadAll();
            FMainDS.DeleteAllRows();
            FMainDS.InsertStandardModalRows();
            FMainDS.SaveChanges();

            FGiftAndJournal.InitialiseData("load-data.sql");

            decimal selectedRate;
            DateTime selectedDate;
            int selectedTime;

            // Open the screen modally on our test ledger and a from currency of GBP
            TFrmSetupDailyExchangeRate mainScreen = new TFrmSetupDailyExchangeRate(null);
            mainScreen.ShowUsedRates();

            DialogBoxHandler = delegate(string name, IntPtr hWnd)
            {
                ExchangeRateUsageHandler();
            };

            DialogResult dlgResult = mainScreen.ShowDialog(STANDARD_TEST_LEDGER_NUMBER,
                FStandardEffectiveDate,
                "GBP",
                1.0m,
                out selectedRate,
                out selectedDate,
                out selectedTime);

            if (dlgResult == DialogResult.Abort)
            {
                Assert.Fail(FModalAssertResult);
            }

            Assert.AreEqual(DialogResult.OK, dlgResult);
        }