예제 #1
0
        public void DeleteRoom_beforEvent()
        {
            bool raisEvent = false;

            _gameCity_ticket_0.BeforDeleteRoomHandler += delegate { raisEvent = true; };
            _gameCity_ticket_0.AddRoom(_room);
            int preCount = _gameCity_ticket_0.Rooms.Count;

            _gameCity_ticket_0.RemoveRoom(_room);
            Assert.True(raisEvent, "删除房间前事件");
            Assert.DoesNotContain <IRoom>(_room, _gameCity_ticket_0.Rooms);
            Assert.True(_gameCity_ticket_0.Rooms.Count - preCount == -1, "房间数量未减少1");
        }