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

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