Ejemplo n.º 1
0
        public static void AdviseUnitTestLaunch(UnityModelAndLifetime modelAndLifetime)
        {
            var modelValue         = modelAndLifetime.Model;
            var connectionLifetime = modelAndLifetime.Lifetime;

            modelValue.UnitTestLaunch.Change.Advise(connectionLifetime, launch =>
            {
                var unityEditorTestLauncher = new UnityEditorTestLauncher(launch);
                unityEditorTestLauncher.TryLaunchUnitTests();
            });
        }
Ejemplo n.º 2
0
        private static void AdviseModel(Lifetime connectionLifetime, UnityModel modelValue)
        {
            modelValue.GetUnityEditorState.Set(rdVoid =>
            {
                if (EditorApplication.isPlaying)
                {
                    return(UnityEditorState.Play);
                }

                if (EditorApplication.isCompiling || EditorApplication.isUpdating)
                {
                    return(UnityEditorState.Refresh);
                }

                return(UnityEditorState.Idle);
            });

            modelValue.UnitTestLaunch.Change.Advise(connectionLifetime, launch =>
            {
                var unityEditorTestLauncher = new UnityEditorTestLauncher(launch);
                unityEditorTestLauncher.TryLaunchUnitTests();
            });
        }