BinaryDataLoadSaveTests SaveAndLoadClassWithEmptyByteArray Method Delta Engine Documentation

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

public void SaveAndLoadClassWithEmptyByteArray()
Examples

[Test]
public void SaveAndLoadClassWithEmptyByteArray()
{
    var instance = new ClassWithByteArray { data = new byte[] { 1, 2, 3 } };
    var data = BinaryDataExtensions.SaveDataIntoMemoryStream(instance);
    var retrieved =
        BinaryDataExtensions.LoadDataWithKnownTypeFromMemoryStream<ClassWithByteArray>(data);
    Assert.IsTrue(instance.data.Compare(retrieved.data));
}
See Also