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(); }); }
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(); }); }