/// <summary>
        /// Initialises Test Mode.
        /// </summary>
        internal void TestMode()
        {
            lastMode = CurrentMode;

            if (hitObjectManager.hitObjects.Count == 0)
            {
                return;
            }
            if (AudioEngine.AudioState == AudioStates.Playing)
            {
                Pause();
            }

            if (Compose != null)
            {
                Compose.FinishPlacement();
                Compose.RemovePlacementObject();
            }

            FinishBreakDrag();
            changeManager.FinishAction();

            if (AudioEngine.BeatLength <= 0)
            {
                MessageBox.Show(LocalisationManager.GetString(OsuString.EditorControl_OneSectionRequiredWarning), @"osu!", MessageBoxButtons.OK);
                return;
            }

            changeManager.IgnorePush = true;
            while (!AudioEngine.ControlPoints[0].TimingChange)
            {
                AudioEngine.ControlPoints.RemoveAt(0);
                AudioEngine.UpdateActiveTimingPoint(false);
            }
            changeManager.IgnorePush = false;

            AiModClose();

            CloseImportDialog();

            GameBase.TestMode = true;
            GameBase.TestTime = AudioEngine.Time;

            Beatmap b = hitObjectManager.Beatmap;

            Player.Mode = b.PlayMode;

            if (hitObjectManager.hitObjects.FindAll(h => h.EndTime > AudioEngine.Time).Count == 0)
            {
                GameBase.TestTime = 0; //There are no hitcircles after the current point.
            }
            if (!changeManager.Dirty || hitObjectManager.Save(true, false, false))
            {
                if (b.DifficultyTomStars(b.PlayMode) < 0)
                {
                    b.ComputeAndSetDifficultiesTomStars(b.PlayMode);
                }

                HideDifficultySwitch();
                GameBase.ChangeModeInstant(OsuModes.Play);
            }
            else
            {
                GameBase.TestMode = false;
            }
        }