ScrollbarTests 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()
{
    scrollbar.CenterValue = 20;
    var stream = BinaryDataExtensions.SaveToMemoryStream(scrollbar);
    var loadedScrollbar = (Scrollbar)stream.CreateFromMemoryStream();
    Assert.AreEqual(center, loadedScrollbar.DrawArea);
    Assert.AreEqual(20, loadedScrollbar.CenterValue);
    Assert.AreEqual(scrollbar.Get<Picture>().Material.DefaultColor,
        loadedScrollbar.Get<Picture>().Material.DefaultColor);
}
See Also