public void getSystemNamesTest()
        {
            SystemNameReader read = new SystemNameReader(@"C:\Dokumente und Einstellungen\JG\Eigene Dateien\Visual Studio 2008\Projects\BloxVarReader\BloxVarReader\bin\Debug\TestCase");

            string[] systems = read.getAvailableSystems();

            for(int i = 0; i < systems.Length; i++) {
                Assert.AreEqual(expectedSystems[i],systems[i]);
            }
        }
        public void invalidTradingBloxDirectoryTest()
        {
            SystemNameReader read = new SystemNameReader(@"C:\");

            string[] systems = read.getAvailableSystems();
        }
        public void invalidDirectoryTest()
        {
            SystemNameReader read = new SystemNameReader("das ist doch kein Verzeichnis");

            string[] systems = read.getAvailableSystems();
        }
Beispiel #4
0
        private void createSystemCheckBoxes()
        {
            int xValue = CHECKBOX_LEFT_START;
            int yValue = CHECKBOX_TOP_START;
            int controlsInRow = 0;
            int controlsPerRow = (pSystems.Size.Width - CHECKBOX_LEFT_START) / (CHECKBOX_WIDTH + CHECKBOX_HORIZONTAL_SPACING);
            string[] systemNames;
            SystemNameReader sysReader = new SystemNameReader(tbBloxDir.Text);
            lblSystems.Text = "Systems:";
            try {
                systemNames = sysReader.getAvailableSystems();
            } catch (DirectoryNotFoundException de) {
                MessageBox.Show("Directory not a valid TradingBlox Directory", "Incorrect Information",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            systemCheckBoxes = new CheckBox[systemNames.Length];

            for (int i = 0; i < systemNames.Length; i++) {
                systemCheckBoxes[i] = new CheckBox();
                systemCheckBoxes[i].Text = systemNames[i];
                systemCheckBoxes[i].Size = new Size(CHECKBOX_WIDTH, CHECKBOX_HEIGHT);
                systemCheckBoxes[i].Checked = true;

                //Position der checkBoxes
                systemCheckBoxes[i].Location = new Point(xValue, yValue);
                xValue += systemCheckBoxes[i].Size.Width + CHECKBOX_HORIZONTAL_SPACING;

                controlsInRow++;
                if (controlsInRow == controlsPerRow) {
                    xValue = CHECKBOX_LEFT_START;
                    yValue += systemCheckBoxes[i].Size.Height + CHECKBOX_VERTICAL_SPACING;
                    controlsInRow = 0;
                }
            }
            pSystems.Controls.Clear();
            pSystems.Controls.AddRange(systemCheckBoxes);
        }