public void ProcessNormal_ThrowsWhenSubmeshCollecionIsEmpty() { Mesh mesh = new Mesh(); ObjParsingWorker worker = new ObjParsingWorker(); Assert.That(() => worker.ProcessNormal(string.Empty, mesh), Throws.InvalidOperationException); }
public void ProcessNormal_ShouldReturnWhereThereIsInvalidNumberOfTokens(string line) { Mesh mesh = new Mesh(); mesh.SubMeshes.Add(new SubMesh()); ObjParsingWorker worker = new ObjParsingWorker(); worker.ProcessNormal(line, mesh); Assert.That(mesh.SubMeshes.Last().Textures, Is.Empty); }
public void ProcessNormal_ShouldAddTextureToTheLastSubmesh() { Mesh mesh = new Mesh(); mesh.SubMeshes.Add(new SubMesh()); mesh.SubMeshes.Add(new SubMesh()); float x = 1.000000f; float y = 1.000000f; float z = 1.000000f; string line = $"v {x} {y} {z}"; ObjParsingWorker worker = new ObjParsingWorker(); worker.ProcessNormal(line, mesh); Vector3 lastTexture = mesh.SubMeshes.Last().Normals.First(); Assert.That(lastTexture.X, Is.EqualTo(x)); Assert.That(lastTexture.Y, Is.EqualTo(y)); }