Пример #1
0
        public void UpdateRoomTest()
        {
            var  service = new Service1();
            Room room    = new Room
            {
                Number    = "tt",
                Roominess = 15
            };

            Room roomPrev = new Room();

            roomPrev = service.AddRoom(room);

            Room roomPlug = new Room();

            roomPlug           = roomPrev;
            roomPlug.Number    = "df";
            roomPlug.Roominess = 15;
            service.UpdateRoom(roomPlug);


            Room roomPost = new Room();

            roomPost = service.FindByIDRoom(roomPrev.ID_Room);

            service.DeleteUser(roomPost.ID_Room);

            Assert.AreNotEqual(roomPrev, roomPost);
        }
Пример #2
0
        public void AddRoomTest()
        {
            var  service     = new Service1();
            var  roomColPrev = service.SelectRoom().Count;
            Room room        = new Room
            {
                Number    = "tt",
                Roominess = 16
            };
            Room room2 = new Room();

            room2 = service.AddRoom(room);

            var roomColPost = service.SelectRoom().Count;

            service.DeleteRoom(room2.ID_Room);

            Assert.AreEqual(roomColPrev + 1, roomColPost);
        }
Пример #3
0
        public void FindByIDRoomTest()
        {
            Service1 service = new Service1();
            Room     room    = new Room
            {
                Number    = "TestRoom",
                Roominess = 15
            };

            Room roomPrev = new Room();

            roomPrev = service.AddRoom(room);

            Room roomPost = new Room();

            roomPost = service.FindByIDRoom(roomPrev.ID_Room);

            service.DeleteRoom(roomPrev.ID_Room);

            Assert.AreEqual(roomPrev.ID_Room, roomPost.ID_Room);
        }