public void ACounterCanFlipBetweenColours(string originalColour, string newColour) { var counter = new Counter(originalColour); Assert.That(originalColour, Is.EqualTo(counter.ColourDisplayed)); counter.Flip(); Assert.That(newColour, Is.EqualTo(counter.ColourDisplayed)); }
public void APieceCanOnlyBePlacedNextToAPieceOfTheOppositeColour(string gridRef, bool result) { var board = new OthelloBoard(); var counter = new Counter {Colour = "black"}; board.AcceptPlay(gridRef, counter); Assert.That(board.ViewBoardSquare(gridRef) == counter, Is.EqualTo(result)); }
public void ASquareKnowsItsContents(string newContents, string originalContents) { var square = new Square(); var counter = new Counter(); counter.Colour = originalContents; square.PlacePiece(counter); counter.Flip(); Assert.That(square.Contents().Colour, Is.EqualTo(newContents)); }
public void APieceCanOnlyBePlacedIfALineEndsInAPieceOfTheSameColour() { var board = new OthelloBoard(); var counter1 = new Counter {Colour = "black"}; var counter2 = new Counter {Colour = "white"}; var counter3 = new Counter {Colour = "black"}; var counter4 = new Counter {Colour = "white"}; board.AcceptPlay("E3", counter1); Assert.That(board.ViewBoardSquare("E3"), Is.Not.EqualTo(counter1)); board.AcceptPlay("D3", counter1); Assert.That(board.ViewBoardSquare("D3"), Is.EqualTo(counter1)); board.AcceptPlay("D2", counter2); Assert.That(board.ViewBoardSquare("D2"), Is.Not.EqualTo(counter2)); board.AcceptPlay("C3", counter2); Assert.That(board.ViewBoardSquare("C3"), Is.EqualTo(counter2)); board.AcceptPlay("C4", counter3); Assert.That(board.ViewBoardSquare("C4"), Is.EqualTo(counter3)); board.AcceptPlay("E3", counter4); Assert.That(board.ViewBoardSquare("E3"), Is.EqualTo(counter4)); }
public PasswordGenerator() { _counter = new Counter(); _validator = new PasswordValidator(); }
private void PlaceInitialPieces() { var whitePiece = new Counter() {Colour = "white"}; var whitePiece2 = new Counter() {Colour = "white"}; var blackPiece = new Counter() {Colour = "black"}; var blackPiece2 = new Counter() {Colour = "black"}; SetUp("D4", whitePiece); SetUp("E5", whitePiece2); SetUp("D5", blackPiece); SetUp("E4", blackPiece2); }