public void NonBlankSquaresCannotBeMarked() { var sut = new MarkCommand(fakeBoard, 0, 0); sut.Execute(null); sut.CanExecute(null).Should().BeFalse(); }
public void TheMarkCommandShouldMarkTheBoard() { var sut = new MarkCommand(fakeBoard, 0, 0); sut.Execute(null); fakeBoard[0, 0].Should().NotBe(Sigil.Blank); }
public SquareViewModel(IBoard board, int row, int column) { Debug.Assert(board != null); Sigil = string.Empty; Background = new SolidColorBrush(Colors.White); MarkCommand = new MarkCommand(board, row, column); board.MonitorSquare(Update, row, column); }
public void TestColumns() { Expect.Once.On(m_ResultViewHelper).Method("AddColumn").With("Determinate", "!Test"); for (int i = 0; i < 10; i++) { Expect.Once.On(m_ResultViewHelper).Method("AddItem"); } IRandom random = m_Mockery.NewMock <IRandom>(); Project project = new Project(random); Rule rule = new Rule(); Expect.AtLeastOnce.On(random).Method("NextDouble").Will(Return.Value((double)0.5)); rule.Name = "test"; rule.Probability = 1.0; rule.LineNumber = 1; LiteralCommand a = new LiteralCommand(); a.Literal = "a"; rule.Commands.Add(a); Rule rule2 = new Rule(); rule2.Name = "test2"; rule2.Probability = 1.0; rule2.LineNumber = 1; LiteralCommand b = new LiteralCommand(); b.Literal = "b"; rule2.Commands.Add(b); project.Rules.Add(rule); project.Rules.Add(rule2); MarkCommand m = new MarkCommand(); m.Name = "Test"; m.Value = "yes"; rule2.Commands.Add(m); project.StartRules.Add("test", 5); project.StartRules.Add("test2", 5); project.Columns.Add("Determinate", "!Test"); m_GeneratorController.Generate(project); Assert.AreEqual(2, project.StartRules.Count); m_Mockery.VerifyAllExpectationsHaveBeenMet(); }
public void Start() { board = transform.GetComponentInChildren <Board>(); mark = GetComponent <MarkCommand>(); Dictionary <GameMode.Mode, System.Func <Turn> > otherPlayerTurnFactory = new Dictionary <GameMode.Mode, System.Func <Turn> > { { GameMode.Mode.PvPLocal, CreateAnotherLocalPlayer }, { GameMode.Mode.PvPRemote, CreateRemotePlayer } }; PlayerTurn playerTurn = gameObject.AddComponent <PlayerTurn>(); playerTurn.notifyRemote = gameMode.mode == GameMode.Mode.PvPRemote; Turn otherPlayerTurn = otherPlayerTurnFactory[gameMode.mode](); Restart(playerTurn, otherPlayerTurn, gameMode); }
public void BlankSquaresCanBeMarked() { var sut = new MarkCommand(fakeBoard, 0, 0); sut.CanExecute(null).Should().BeTrue(); }
protected void Start() { mark = GetComponent <MarkCommand>(); }