TextBoxTests 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()
{
    var stream = BinaryDataExtensions.SaveToMemoryStream(topTextBox);
    var loadedTextBox = (TextBox)stream.CreateFromMemoryStream();
    Assert.AreEqual(Top, loadedTextBox.DrawArea);
    Assert.AreEqual("Hello", loadedTextBox.Text);
    Assert.AreEqual(2, loadedTextBox.RenderLayer);
    Assert.IsTrue(loadedTextBox.State.CanHaveFocus);
    Assert.AreEqual(topTextBox.children.Count, loadedTextBox.children.Count);
}
See Also