Exemplo n.º 1
0
        public void TestIfClickedRegionHasChangedState()
        {
            var idx = BoardStateManager.ClickedRegion(gameBoard.regions, currentState, previousState);

            BoardStateManager.UpdateClickedRegionState(gameBoard.regions, idx);
            Assert.That(gameBoard.regions[4].state, Is.EqualTo(1));
        }
Exemplo n.º 2
0
 public void ClickInSeparatorLinesRetunsNegative()
 {
     currentState = new MouseState(196, 101, 0, ButtonState.Pressed, ButtonState.Released,
                                   ButtonState.Released, ButtonState.Released, ButtonState.Released);
     Assert.That(BoardStateManager.ClickedRegion(gameBoard.regions, currentState,
                                                 previousState), Is.EqualTo(-1));
 }
Exemplo n.º 3
0
        public void MouseClickedRegion0()
        {
            currentState = new MouseState(105, 105, 0, ButtonState.Pressed, ButtonState.Released,
                                          ButtonState.Released, ButtonState.Released, ButtonState.Released);

            Assert.That(BoardStateManager.ClickedRegion(gameBoard.regions, currentState, previousState), Is.EqualTo(0));
        }
Exemplo n.º 4
0
        public void TestIfClickIsOutsideRegions()
        {
            var current = new MouseState(50, 50, 0, ButtonState.Pressed, ButtonState.Released,
                                         ButtonState.Released, ButtonState.Released, ButtonState.Released);

            Assert.That(BoardStateManager.ClickedRegion(gameBoard.regions, current,
                                                        previousState), Is.EqualTo(-1));
        }
Exemplo n.º 5
0
        public void ClickedRegionHasChangedState()
        {
            currentState = new MouseState(250, 250, 0, ButtonState.Pressed, ButtonState.Released,
                                          ButtonState.Released, ButtonState.Released, ButtonState.Released);
            var idx = BoardStateManager.ClickedRegion(gameBoard.regions, currentState, previousState);

            BoardStateManager.UpdateClickedRegionState(gameBoard.regions, idx);
            Assert.That(gameBoard.regions[4].State, Is.EqualTo(1));
        }
Exemplo n.º 6
0
 public void TestIfTheRegionIsClicked()
 {
     Assert.That(BoardStateManager.ClickedRegion(gameBoard.regions, currentState,
                                                 previousState), Is.EqualTo(4));
 }