コード例 #1
0
ファイル: Form1.cs プロジェクト: MOBA94/TestBookRoomOwner
        ////private void button1_Click(object sender, EventArgs e) {
        ////    this.lbxEsc.Items.Clear();
        ////    EscapeRoomServices es = new EscapeRoomServices();
        ////    //List<EscapeRoom> escapeRooms = es.GetAllForOwner();


        ////    foreach (EscapeRoom escapeRoom in escapeRooms) {
        ////        this.lbxEsc.Items.Add(escapeRoom.name);
        ////    }

        ////}

        private void button2_Click(object sender, EventArgs e)
        {
            EscapeRoomServices es = new EscapeRoomServices();
            int num = int.Parse(txtID.Text);

            lblEsc.Text = es.GetForOwner(num).Name;
        }
コード例 #2
0
        public void TestMethod1( )
        {
            //Arrange
            EscapeRoomServices ess    = new EscapeRoomServices();
            EmployeeCtr        empCtr = new EmployeeCtr();

            MAPMAClient.Model.EscapeRoom Es1 = new MAPMAClient.Model.EscapeRoom();
            MAPMAClient.Model.Employee   Em1 = empCtr.Get(1);
            Es1.Name         = "The Dark Room";
            Es1.Description  = "The Fors is Strong in the darkside";
            Es1.MaxClearTime = 180;
            Es1.CleanTime    = 90;
            Es1.Price        = 1200;
            Es1.Rating       = 0;
            Es1.Emp          = Em1;
            Es1.Image        = null;



            //Act
            ess.CreateEscapeRoom(Es1.Name, Es1.Description, Es1.MaxClearTime, Es1.CleanTime, Es1.Price, Es1.Rating, Es1.Emp.EmployeeID, Es1.Image);

            //Assert
            List <MAPMAClient.Model.EscapeRoom> escapeRooms = new List <MAPMAClient.Model.EscapeRoom>();

            escapeRooms = ess.GetAllForOwner();
            bool found = false;
            int  i     = 0;

            MAPMAClient.Model.EscapeRoom EsR = new MAPMAClient.Model.EscapeRoom();


            while (i < escapeRooms.Count && !found)
            {
                if (escapeRooms.ElementAt(i).Name.Equals(Es1.Name))
                {
                    EsR   = escapeRooms.ElementAt(i);
                    found = true;
                }
                else
                {
                    i++;
                }
            }

            Assert.IsTrue(found);

            if (EsR.EscapeRoomID != 0)
            {
                ess.DeleteEscapeRoom(EsR.EscapeRoomID);
            }
        }
コード例 #3
0
 /// <summary>
 /// Makes a new EscapeRoomServices named ERS
 /// </summary>
 public EscapeRoomCtr()
 {
     ERS = new EscapeRoomServices();
 }