Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
DeltaEngine.Scenes.Tests.Controls PictureTests
Namespace: DeltaEngine.Scenes.Tests.Controls
Assembly: DeltaEngine.Scenes.Tests (in DeltaEngine.Scenes.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The PictureTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
PictureTests | Initializes a new instance of the PictureTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
DrawLoadedPicture | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
SaveAndLoad | ||
SetAppearance | ||
SetAppearanceWithNullShouldReturn | ||
SetAppearanceWithoutInterpolation | ||
SetAppearanceWithoutInterpolationWithNullShouldReturn | ||
SetUp |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test, CloseAfterFirstFrame] public void SaveAndLoad() { var stream = BinaryDataExtensions.SaveToMemoryStream(picture); var loadedPicture = (Picture)stream.CreateFromMemoryStream(); Assert.AreEqual("DeltaEngineLogo", loadedPicture.Material.DiffuseMap.Name); Assert.AreEqual("DeltaEngineLogo", loadedPicture.Get<Theme>().SliderPointer.DiffuseMap.Name); Assert.AreEqual(Rectangle.HalfCentered, loadedPicture.DrawArea); }
[Test] public void DrawLoadedPicture() { picture.IsActive = false; picture = new Picture(new Theme(), material, Rectangle.HalfCentered); var stream = BinaryDataExtensions.SaveToMemoryStream(picture); picture.IsActive = false; stream.CreateFromMemoryStream(); }
[Test] public void SetAppearance() { material = new Material(Color.Red); picture.SetAppearance(material); Assert.AreEqual(material, picture.Material); Assert.AreEqual(material.DefaultColor, picture.Color); }
[Test] public void SetAppearanceWithNullShouldReturn() { Assert.DoesNotThrow(() => picture.SetAppearance(null)); }
[Test] public void SetAppearanceWithoutInterpolationWithNullShouldReturn() { Assert.DoesNotThrow(() => picture.SetAppearanceWithoutInterpolation(null)); }
[Test] public void SetAppearanceWithoutInterpolation() { var newMaterial = new Material(Color.Red); picture.SetAppearanceWithoutInterpolation(newMaterial); Assert.AreEqual(newMaterial, picture.Material); Assert.AreEqual(newMaterial.DefaultColor, picture.Color); }
See Also