public static void Setup(TestContext context) { var targetDevice = new TargetDevice {GameType = typeof (MockGame)}; EngineRuntime.Instance.Initialize(targetDevice); Game = EngineRuntime.Instance.CurrentGame as MockGame; }
public void MakeNoMove() { var g = new MockGame(); bool result = g.MakeMove(); Assert.IsFalse(result); }
public void Domain_with_UI() { var ui = new MockUI(); var game = new MockGame(); Program.Integrate(new[] { "leiterspielbrett1.txt" }, ui, game); game.Fire_Game_over(); Assert.AreEqual("1", ui.Received); }
public void AddMove() { var g = new MockGame(); var from = new Position(1, 1); var to = new Position(2, 2); var m = new ConcreteMove(from, to); g.AddMove(m); Assert.AreEqual(1, g.MovesCount); }
public void MakeMoveIsStateChanged() { var g = new MockGame(); var from = new Position(1, 1); var to = new Position(2, 2); var p = new Piece(); var m = new ConcreteMove(from, to); g.State[from] = p; p.Move(from); g.AddMove(m); g.MakeMove(); Assert.AreEqual(p, g.State[to]); }
public void MakeMove() { var g = new MockGame(); var from = new Position(1, 1); var to = new Position(2, 2); var p = new Piece(); var m = new ConcreteMove(from, to); g.State[from] = p; p.Move(from); g.AddMove(m); bool result = g.MakeMove(); Assert.AreEqual(1, g.MovesCount); Assert.AreEqual(1, g.CurrentMove); Assert.IsTrue(result); }
public void Init() { _sut = MockGame.ThatIsNearlyDone(); }
public void Init() { _sut = MockGame.ThatIsOnTheFirstTurn(); }
public virtual void TearDown() { _game.Dispose(); _game = null; }
public virtual void SetUp() { Paths.SetStandardWorkingDirectory(); _game = new MockGame(); }
public void Init() { InitWithGame(MockGame.ThatIsWaitingForBothPlayersToPlaceAShip()); _readResult = _sut.Read(_id, "someUser"); }
public void Init() { InitWithGame(MockGame.ThatIsWaitingForBothPlayersToPlaceAShip()); _createResult = _sut.Create("myPlayer1", "myPlayer2", "powerUser"); }
public void Init() { InitWithGame(MockGame.ThatIsOnTheFirstTurn()); _sut.Attack(_id, "myPlayer1", new Location("A3")); }
public void Init() { InitWithGame(MockGame.ThatIsWaitingForBothPlayersToPlaceAShip()); _sut.PlaceShip(_id, "myPlayer1", new Location("A3"), new Location("A5")); }
public void Init() { game = new MockGame(); s = new InGameState(game); }
public void Init() { Game = new MockGame(DoNothing); Game.RunOnce(); }