Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
DeltaEngine.Scenes.Tests.Controls ThemeTests
Namespace: DeltaEngine.Scenes.Tests.Controls
Assembly: DeltaEngine.Scenes.Tests (in DeltaEngine.Scenes.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The ThemeTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ThemeTests | Initializes a new instance of the ThemeTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
LoadTheme | ||
LoadThemeFromFile | ||
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
SaveAndLoadDefaultTheme | ||
SaveAndLoadModifiedTheme |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test, CloseAfterFirstFrame] public void SaveAndLoadDefaultTheme() { var theme = new Theme(); var stream = BinaryDataExtensions.SaveToMemoryStream(theme); var loadedTheme = (Theme)stream.CreateFromMemoryStream(); Assert.IsTrue(AreMaterialsEqual(theme.ButtonMouseover, loadedTheme.ButtonMouseover)); Assert.IsTrue(AreMaterialsEqual(theme.ScrollbarPointer, loadedTheme.ScrollbarPointer)); Assert.IsTrue(AreMaterialsEqual(theme.TextBoxFocused, loadedTheme.TextBoxFocused)); }
[Test, CloseAfterFirstFrame] public void SaveAndLoadModifiedTheme() { var theme = new Theme(); theme.Slider = new Material(ShaderFlags.Position2DColoredTextured, "DeltaEngineLogo") { DefaultColor = Color.Red }; var stream = BinaryDataExtensions.SaveToMemoryStream(theme); var loadedTheme = (Theme)stream.CreateFromMemoryStream(); Assert.IsTrue(AreMaterialsEqual(theme.Slider, loadedTheme.Slider)); }
[Test, CloseAfterFirstFrame] public void LoadTheme() { Theme theme = CreateSampleTheme(); var loadedData = new ThemeLoader().LoadValidData(dataStream); AssertLoadedThemeData(theme, loadedData); }
[Test, CloseAfterFirstFrame] public void LoadThemeFromFile() { Theme theme = CreateSampleTheme(); var loadedData = new Theme(); loadedData.LoadFromFile(dataStream); AssertLoadedThemeData(theme, loadedData); }
See Also