Esempio n. 1
0
        public void TestAddBatchType()
        {
            bool success1 = BatchTypeController.AddBatchType(type1);
            bool success2 = BatchTypeController.AddBatchType(type2);
            bool success3 = BatchTypeController.AddBatchType(type3);
            bool success4 = BatchTypeController.AddBatchType(type4);

            Assert.IsTrue(success1 && success2 && success3 && success4);
        }
Esempio n. 2
0
        /// <summary>
        /// Handles the Click event of the btnAdd control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            BatchType          newType   = new BatchType();
            AddBatchTypeWindow newWindow = new AddBatchTypeWindow(newType);

            if (newWindow.ShowDialog().Value)
            {
                try
                {
                    BatchTypeController.AddBatchType(newType);
                }
                catch
                {
                    MessageBox.Show("Error adding batch type.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }

                _batchTypes.Add(newType);
                MessageBox.Show("Added batch type!");
            }
        }
Esempio n. 3
0
 public void TestAddBatchError()
 {
     BatchTypeController.AddBatchType(null);
 }