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

            SC.CreateStorageRoom("TestRoom", "Dette TestRum er kun til test");
            int new_id = StorageRoom.GetNextID();

            Assert.IsTrue((new_id > old_id) && SC.StorageRoomDictionary.ContainsKey(old_id));
        }
Пример #2
0
 public void SetupCreate()
 {
     output_StorageID.Text  = StorageRoom.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 storageRoomName  = textBox_Name.Text;
             string storageRoomDescr = textBox_descr.Text;
             ControllerSto.CreateStorageRoom(storageRoomName, storageRoomDescr);
             this.Close();
         }
     };
 }