@@ -39,15 +39,17 @@ public void ClearScene()
3939 public void SetLayerRecursivelyNull ( )
4040 {
4141
42- Assert . Throws ( typeof ( System . ArgumentNullException ) , ( ) => {
42+ Assert . Throws ( typeof ( System . ArgumentNullException ) , ( ) =>
43+ {
4344 GameObjectExtensions . SetLayerRecursively ( null , waterLayer ) ;
4445 } ) ;
4546 }
4647
4748 [ Test ]
4849 public void SetLayerRecursivelyCacheNull ( )
4950 {
50- Assert . Throws ( typeof ( System . ArgumentNullException ) , ( ) => {
51+ Assert . Throws ( typeof ( System . ArgumentNullException ) , ( ) =>
52+ {
5153 Dictionary < GameObject , int > layerCache ;
5254 GameObjectExtensions . SetLayerRecursively ( null , waterLayer , out layerCache ) ;
5355 } ) ;
@@ -56,7 +58,8 @@ public void SetLayerRecursivelyCacheNull()
5658 [ Test ]
5759 public void ApplyLayerCacheRecursivelyNull ( )
5860 {
59- Assert . Throws ( typeof ( System . ArgumentNullException ) , ( ) => {
61+ Assert . Throws ( typeof ( System . ArgumentNullException ) , ( ) =>
62+ {
6063 Dictionary < GameObject , int > layerCache = new Dictionary < GameObject , int > ( ) ;
6164 GameObjectExtensions . ApplyLayerCacheRecursively ( null , layerCache ) ;
6265 } ) ;
@@ -66,7 +69,8 @@ public void ApplyLayerCacheRecursivelyNull()
6669 public void ApplyLayerCacheRecursivelyNullCache ( )
6770 {
6871 var parent = Object . Instantiate ( empty ) ;
69- Assert . Throws ( typeof ( System . ArgumentNullException ) , ( ) => {
72+ Assert . Throws ( typeof ( System . ArgumentNullException ) , ( ) =>
73+ {
7074 parent . ApplyLayerCacheRecursively ( null ) ;
7175 } ) ;
7276 }
@@ -205,5 +209,27 @@ public void ApplyLayerCacheRecursivelyNestedBranch()
205209 Assert . That ( transform . gameObject . layer , Is . Not . EqualTo ( waterLayer . value ) ) ;
206210 }
207211 }
212+
213+ [ TestCase ( "1234" , "1234" ) ]
214+ [ TestCase ( "Foo" , "Foo" ) ]
215+ [ TestCase ( "Foo/Bar" , "Foo" , "Bar" ) ]
216+ [ TestCase ( "Foo/Bar/Baz" , "Foo" , "Bar" , "Baz" ) ]
217+ [ TestCase ( "Foo/Bar/?__/ä/124" , "Foo" , "Bar" , "?__" , "ä" , "124" ) ]
218+ public void GetFullPathTests ( string result , params string [ ] names )
219+ {
220+ //TODO: Delete with GameObjectExtensions.GetFullPath
221+ if ( names . Length == 0 ) { Assert . IsFalse ( false , "Invalid test case" ) ; }
222+ var parent = Object . Instantiate ( empty ) ;
223+ parent . name = names [ 0 ] ;
224+ for ( var i = 1 ; i < names . Length ; i ++ )
225+ {
226+ parent = Object . Instantiate ( empty , parent . transform ) ;
227+ parent . name = names [ i ] ;
228+ }
229+
230+ #pragma warning disable 618
231+ Assert . That ( parent . GetFullPath ( ) , Is . EqualTo ( result ) ) ;
232+ #pragma warning restore 618
233+ }
208234 }
209235}
0 commit comments