示例#1
0
        public void TestGetMachineIDs()
        {
            List <string> tests;
            List <string> emptyTests;

            tests = MachineController.GetMachineIDs();
            CleanUp();
            emptyTests = MachineController.GetMachineIDs();

            Assert.AreEqual(_batch1.MachineID, tests[0]);
            Assert.AreEqual(_batch2.MachineID, tests[1]);
            Assert.AreEqual(_batch3.MachineID, tests[2]);
            Assert.AreEqual(_batch4.MachineID, tests[3]);
            Assert.AreEqual(_batch5.MachineID, tests[4]);
            Assert.AreEqual(_batch6.MachineID, tests[5]);
            Assert.AreEqual(emptyTests, null);
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HistoryWindow"/> class.
        /// </summary>
        public HistoryWindow()
        {
            InitializeComponent();

            try
            {
                _machineIDs = MachineController.GetMachineIDs();
            }
            catch
            {
                MessageBox.Show("Error getting Machine IDs.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            try
            {
                _batches = BatchController.GetAllBatches();
            }
            catch
            {
                MessageBox.Show("Error getting Batches.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            try
            {
                _batchTypes = BatchTypeController.GetAllBatchTypes();
            }
            catch
            {
                MessageBox.Show("Error getting Batch Types.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            cboMachines.ItemsSource   = _machineIDs;
            cboMachines.SelectedIndex = 0;

            cboBatchTypes.ItemsSource   = _batchTypes;
            cboBatchTypes.SelectedIndex = 0;

            dgHistory.ItemsSource = _batches;
        }