DatatypesLoadSaveTests SaveAndLoadVector2D 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 SaveAndLoadVector2D()
Examples

[Test]
public void SaveAndLoadVector2D()
{
    var data = BinaryDataExtensions.SaveToMemoryStream(Vector2D.Half);
    byte[] savedBytes = data.ToArray();
    Assert.AreEqual(1 + 4 + "Vector2D".Length + Vector2D.SizeInBytes, savedBytes.Length);
    Assert.AreEqual("Vector2D".Length, savedBytes[0]);
    var reconstructed = data.CreateFromMemoryStream();
    Assert.AreEqual(Vector2D.Half, reconstructed);
}
See Also