Namespace: DeltaEngine.Tests.Datatypes
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
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); }
[Test] public void SaveAndLoadVector() { var data = BinaryDataExtensions.SaveToMemoryStream(Vector3D.UnitZ); byte[] savedBytes = data.ToArray(); Assert.AreEqual(1 + 4 + "Vector3D".Length + Vector3D.SizeInBytes, savedBytes.Length); Assert.AreEqual("Vector3D".Length, savedBytes[0]); var reconstructed = data.CreateFromMemoryStream(); Assert.AreEqual(Vector3D.UnitZ, reconstructed); }
See Also