File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Assets/FbxExporters/Editor/UnitTests Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -209,13 +209,22 @@ public void MapNameToSourceTest()
209
209
210
210
var dictionary = ConvertToModel . MapNameToSourceRecursive ( cube , cube2 ) ;
211
211
212
+ //Create a broken hierarchy, one that is missing a primitive
213
+ var cube3 = GameObject . CreatePrimitive ( PrimitiveType . Cube ) ;
214
+ var capsule3 = GameObject . CreatePrimitive ( PrimitiveType . Capsule ) ;
215
+ var sphere3 = GameObject . CreatePrimitive ( PrimitiveType . Sphere ) ;
216
+
217
+ var dictionaryBroken = ConvertToModel . MapNameToSourceRecursive ( cube , cube3 ) ;
218
+
212
219
//We expect these to pass because we've given it an identical game object, as it would have after a normal export.
213
220
Assert . AreSame ( capsule2 , dictionary [ capsule . name ] ) ;
214
221
Assert . AreSame ( sphere2 , dictionary [ sphere . name ] ) ;
215
222
Assert . AreEqual ( quad2 , dictionary [ quad . name ] ) ;
216
223
217
224
//the dictionary size should be equal to the amount of children + the parent
218
225
Assert . True ( dictionary . Count == cube . transform . childCount + 1 ) ;
226
+
227
+ Assert . AreNotSame ( quad , dictionaryBroken [ quad . name ] ) ;
219
228
}
220
229
}
221
230
}
You can’t perform that action at this time.
0 commit comments