Пример #1
0
        public void CreateGroupStorageControllerTest()
        {
            int old_id = Group.GetNextID();

            SC.CreateGroup("TestGroup", "TestGroupDesc");
            int  new_id = Group.GetNextID();
            bool Rest   = (new_id > old_id) && SC.GroupDictionary.ContainsKey(old_id);

            Assert.IsTrue(Rest);
        }
Пример #2
0
 public void SetupCreate()
 {
     output_GroupID.Text    = Group.GetNextID().ToString();
     btn_JustQuit.Click    += delegate { this.Close(); };
     btn_SaveAndQuit.Click += delegate
     {
         if (textBox_Name.Text == "" || textBox_descr.Text == "")
         {
             textBox_Name.BorderBrush  = Brushes.DarkGray;
             textBox_descr.BorderBrush = Brushes.DarkGray;
             if (textBox_Name.Text == "")
             {
                 textBox_Name.BorderBrush = Brushes.Red;
             }
             if (textBox_descr.Text == "")
             {
                 textBox_descr.BorderBrush = Brushes.Red;
             }
         }
         else
         {
             string groupName  = textBox_Name.Text;
             string groupDescr = textBox_descr.Text;
             ControllerSto.CreateGroup(groupName, groupDescr);
             this.Close();
         }
     };
 }