public void IsNullLetterTileTest() { LetterTile lt = new LetterTile('n', 0); Assert.IsTrue(lt.IsNullLetterTile()); lt = new LetterTile('A', 1); Assert.IsFalse(lt.IsNullLetterTile()); }
/// <summary> /// Inserts a LetterTile into the LetterTileRack. Throws InvalidLetterTileInsertionException. /// </summary> /// <param name="letterTileToBeInserted">The LetterTile that is being inserted into the LetterTileRack.</param> public void InsertLetterTile(LetterTile letterTileToBeInserted) { if (this.containedLetterTileSet.Count == 7) { throw new InvalidLetterTileInsertionException("The insertion of letter tile with LetterValue == " + letterTileToBeInserted.LetterValue + " and PointValue == " + letterTileToBeInserted.PointValue + " is invalid. The LetterTileRack is full."); } else { // Inserting a null LetterTile is the equivalent of not inserting anything. if (!letterTileToBeInserted.IsNullLetterTile()) { this.containedLetterTileSet.Add(letterTileToBeInserted); } } }