1515using System . Threading ;
1616using System . Threading . Tasks ;
1717using UnityEditor ;
18- using UnityEngine ;
1918using UnityEngine . Audio ;
2019using UnityEngine . TestTools ;
2120using Object = UnityEngine . Object ;
@@ -53,11 +52,11 @@ public class SceneLoadingScreenControllerInputBlockShould
5352 // suppression is still active, instead of leaking into an unrelated later test.
5453 private const int FLUSH_FRAME_COUNT = 30 ;
5554
56- private World world ;
55+ private World ? world ;
5756 private SingleInstanceEntity inputMapEntity ;
58- private IInputBlock inputBlock ;
59- private SceneLoadingScreenView viewInstance ;
60- private AudioMixerVolumesController audioMixerVolumesController ;
57+ private IInputBlock ? inputBlock ;
58+ private SceneLoadingScreenView ? viewInstance ;
59+ private AudioMixerVolumesController ? audioMixerVolumesController ;
6160 private bool originalIgnoreFailingMessages ;
6261
6362 [ OneTimeSetUp ]
@@ -119,7 +118,7 @@ public void TearDown()
119118 if ( viewInstance != null )
120119 Object . DestroyImmediate ( viewInstance . gameObject ) ;
121120
122- world . Dispose ( ) ;
121+ world ! . Dispose ( ) ;
123122
124123 // Reset the static field so later tests in the same run aren't left with a stale in-memory
125124 // prefs instance (mirrors the reset half of the same established pattern).
@@ -203,10 +202,11 @@ public async Task ReleaseInputBlockWhenCloseRacesTheInitialTipsLoadAsync()
203202 }
204203 catch ( NullReferenceException )
205204 {
206- // Pre-existing, separate defect (review.md finding 1): unpatched OnViewClose() calls
207- // tips.Release() on a still-default `tips` and throws. That defect is not what is under
208- // test here - what matters is whether the input block was released before that
209- // statement could run at all, which is asserted below regardless of this exception.
205+ // An artifact of the never-resolving tips mock above: OnViewClose() calls tips.Release()
206+ // on a still-default `tips` and throws. The real ISceneTipsProvider implementations
207+ // resolve synchronously, so in production `tips` is always assigned before any close.
208+ // It is not what is under test here - what matters is whether the input block was
209+ // released before that statement could run at all, asserted below regardless.
210210 }
211211
212212 Assert . That ( ActiveKinds ( ) , Is . EqualTo ( ALL_KINDS ) ,
@@ -221,7 +221,7 @@ public async Task ReleaseInputBlockWhenCloseRacesTheInitialTipsLoadAsync()
221221 }
222222
223223 private SceneLoadingScreenController CreateController ( ISceneTipsProvider tipsProvider ) =>
224- new ( ( ) => viewInstance , tipsProvider , TimeSpan . Zero , audioMixerVolumesController , inputBlock ) ;
224+ new ( ( ) => viewInstance ! , tipsProvider , TimeSpan . Zero , audioMixerVolumesController ! , inputBlock ! ) ;
225225
226226 private static SceneLoadingScreenController . Params CompletedParams ( )
227227 {
@@ -231,7 +231,7 @@ private static SceneLoadingScreenController.Params CompletedParams()
231231 }
232232
233233 private InputMapComponent . Kind ActiveKinds ( ) =>
234- inputMapEntity . GetInputMapComponent ( world ) . Active ;
234+ inputMapEntity . GetInputMapComponent ( world ! ) . Active ;
235235
236236 private static InputMapComponent . Kind AllKinds ( )
237237 {
0 commit comments