ButtonTests SaveAndLoad Method Delta Engine Documentation

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

public void SaveAndLoad()
Examples

[Test, CloseAfterFirstFrame]
public void SaveAndLoad()
{
    button.Name = "New Name";
    var stream = BinaryDataExtensions.SaveToMemoryStream(button);
    var loadedButton = (Button)stream.CreateFromMemoryStream();
    Assert.AreEqual(Center, loadedButton.DrawArea);
    Assert.AreEqual("Click Me", loadedButton.Text);
    Assert.AreEqual("New Name", loadedButton.Name);
}
See Also