ControlTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Scenes.Tests.Controls ControlTests

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

public class ControlTests : TestWithMocksOrVisually

The ControlTests type exposes the following members.

Constructors

  NameDescription
Public methodControlTests
Initializes a new instance of the ControlTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodEachControlShouldHaveAnUniqueName
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void EachControlShouldHaveAnUniqueName()
{
    var button1 = new Button(new Theme(), new Rectangle());
    Assert.IsTrue(button1.Name.StartsWith("Button"));
    var button2 = new Button(new Theme(), new Rectangle());
    Assert.IsTrue(button2.Name.StartsWith("Button"));
    Assert.AreNotEqual(button1.Name, button2.Name);
    var picture1 = new Picture(new Theme(),
        new Material(Color.Red, ShaderFlags.Position2DColored), new Rectangle());
    Assert.IsTrue(picture1.Name.StartsWith("Picture"));
}
See Also