Ejemplo n.º 1
0
        public void Start(GameMode gameMode)
        {
            int  playercount = GtaPlayer.All.Count;
            bool success     = true;

            GtaPlayer player = GtaPlayer.Create(499);

            if (GtaPlayer.All.Count - 1 != playercount)
            {
                Console.WriteLine("DisposureTest: Adding didn't add player to pool.");
                success = false;
            }
            player.Dispose();

            if (GtaPlayer.All.Count != playercount)
            {
                Console.WriteLine("DisposureTest: Disposing didn't remove player from pool.");
                success = false;
            }
            try
            {
                player.SetChatBubble("Test!", Color.Yellow, 100, 10);

                Console.WriteLine("DisposureTest: Passed SetChatBubble.");
                success = false;
            }
            catch (ObjectDisposedException)
            {
                Console.WriteLine("DisposureTest: Exception thrown.");
            }

            Console.WriteLine("DisposureTest successful: {0}", success);
        }