Example #1
0
        private void WaitingTilesShouldBe(string tilesString)
        {
            var waitingTiles  = _hand.GetWaitingTiles();
            var expectedTiles = TileFactory.CreateTiles(tilesString);

            waitingTiles.Should().BeEquivalentTo(expectedTiles);
        }
Example #2
0
 private void GivenTiles(string tiles)
 {
     _tiles = TileFactory.CreateTiles(tiles);
 }
Example #3
0
 public void D1114_should_return_collection_with_D14()
 {
     GivenTiles("D1,D1,D1,D4");
     ShouldBeEquivalentToCollection(new[] { TileFactory.CreateTiles("D1,D4") });
 }
Example #4
0
 public Hand(string tilesString)
 {
     _tiles = TileFactory.CreateTiles(tilesString);
 }
 private bool TryRemoveSmallestTriplet(Tile smallestTile)
 {
     return(TryRemoveAllOrNot(TileFactory.CreateTriplet(smallestTile)));
 }
 private bool TryRemoveSmallestSequence(Tile smallestTile)
 {
     return(TileFactory.TryCreateSequence(smallestTile, out var sequence) && TryRemoveAllOrNot(sequence));
 }
Example #7
0
 private void CalculateWaitingTiles(string tiles)
 {
     _possibleWaitingTiles = CalculatePossibleWaitingTiles(TileFactory.CreateTiles(tiles));
 }
Example #8
0
 public void possible_waiting_tiles_should_exclude_4_tiles()
 {
     CalculateWaitingTiles("D3,D3,D3,D3");
     _possibleWaitingTiles.Should().NotContain(TileFactory.CreateTiles("D3"));
 }
Example #9
0
 public void possible_waiting_tiles_should_include_sibling()
 {
     CalculateWaitingTiles("D2,D3");
     _possibleWaitingTiles.Should().Contain(TileFactory.CreateTiles("D1,D4"));
 }
Example #10
0
 public void tiles_themselves_are_also_possible_waiting_tiles()
 {
     CalculateWaitingTiles("D1,D5,D9");
     _possibleWaitingTiles.Should().Contain(TileFactory.CreateTiles("D1,D5,D9"));
 }