Skip to content

Commit 0269dcd

Browse files
author
AJubrey
committed
[ADDED] some tests to check that the members of the broken dictionary were still there and that the size was unaffected.
[FIXED] one of the tests was still assert.areequal instad of assert.aresame
1 parent 8637acd commit 0269dcd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Assets/FbxExporters/Editor/UnitTests/ConvertToModelTest.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,22 @@ public void MapNameToSourceTest()
214214
var capsule3 = GameObject.CreatePrimitive(PrimitiveType.Capsule);
215215
var sphere3 = GameObject.CreatePrimitive(PrimitiveType.Sphere);
216216

217+
capsule3.transform.parent = cube3.transform;
218+
sphere3.transform.parent = cube3.transform;
219+
217220
var dictionaryBroken = ConvertToModel.MapNameToSourceRecursive(cube, cube3);
218221

219222
//We expect these to pass because we've given it an identical game object, as it would have after a normal export.
220223
Assert.AreSame(capsule2, dictionary[capsule.name]);
221224
Assert.AreSame(sphere2, dictionary[sphere.name]);
222-
Assert.AreEqual(quad2, dictionary[quad.name]);
225+
Assert.AreSame(quad2, dictionary[quad.name]);
223226

224227
//the dictionary size should be equal to the amount of children + the parent
225-
Assert.True(dictionary.Count == cube.transform.childCount + 1);
228+
Assert.True(dictionaryBroken.Count == 4);
226229

227-
Assert.AreNotSame(quad, dictionaryBroken[quad.name]);
230+
Assert.IsNull(dictionaryBroken[quad.name]);
231+
Assert.AreSame(capsule3, dictionaryBroken[capsule.name]);
232+
Assert.AreSame(sphere3, dictionaryBroken[sphere.name]);
228233
}
229234
}
230235
}

0 commit comments

Comments
 (0)