Vector3DTests CreateFromString Method Delta Engine Documentation

Namespace: DeltaEngine.Tests.Datatypes
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void CreateFromString()
Examples

[Test]
public void CreateFromString()
{
    var v = new Vector3D("2.3, 1.5, 0.9");
    Assert.AreEqual(v.X, 2.3f);
    Assert.AreEqual(v.Y, 1.5f);
    Assert.AreEqual(v.Z, 0.9f);
    Assert.Throws<Vector3D.InvalidNumberOfComponents>(() => new Vector3D("2.3"));
    Assert.Throws<FormatException>(() => new Vector3D("a, b, c"));
}
See Also