TwoHumanNetworkGameTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    Drench.Tests.Games TwoHumanNetworkGameTests

Namespace: Drench.Tests.Games
Assembly: Drench.Tests (in Drench.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class TwoHumanNetworkGameTests : TestWithMocksOrVisually

The TwoHumanNetworkGameTests type exposes the following members.

Constructors

  NameDescription
Public methodTwoHumanNetworkGameTests
Initializes a new instance of the TwoHumanNetworkGameTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodClickInvalidSquare
Public methodClickValidSquare
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Public methodNewGameInstructions
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Public methodSetUp
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void NewGameInstructions()
{
    Assert.AreEqual("*** Player 1: 1  (Your turn) ***", game1.upperText.Text);
    Assert.AreEqual("Player 2: 1  ", game1.lowerText.Text);
    Assert.AreEqual("*** Player 1: 1  (Waiting for other player's turn) ***",
        game2.upperText.Text);
    Assert.AreEqual("Player 2: 1  ", game2.lowerText.Text);
}
[Test]
public void ClickInvalidSquare()
{
    var firstSquare = new Vector2D(ScreenSpace.Current.Left + Game.Border + 0.01f,
        ScreenSpace.Current.Top + Game.Border + 0.01f);
    ClickMouse(firstSquare);
    Assert.AreEqual("*** Player 1: 1 - Invalid Move! ***", game1.upperText.Text);
    Assert.AreEqual("*** Player 1: 1 (Waiting for other player's turn) ***",
        game2.upperText.Text);
}
[Test]
public void ClickValidSquare()
{
    ClickMouse(Vector2D.Half);
    Assert.AreEqual(" Player 1: 3 Game Over! Player 1 wins! ", game1.upperText.Text);
}
See Also