Exemple #1
0
 public override Word DefineWord()
 {
     if (TargetWord.Equals(string.Empty))
     {
         TargetWord = CharacterSymbol.DEFAULT_EXPRESSION;
     }
     return(new CharacterSymbol(TargetWord, Name, WordType));
 }
Exemple #2
0
 public override Word DefineWord()
 {
     if (TargetWord.Equals(string.Empty))
     {
         TargetWord = ModifiableStringLiteral.MODIFIABLE_IDENTIFIER;
     }
     return(new ModifiableStringLiteral(TargetWord, Name, WordType, Before));
 }
Exemple #3
0
        public void IsCorrect_CheckReturnType_ReturnTrue()
        {
            // Arrange
            TargetWord word = new TargetWord();

            // Act
            bool isCorrectLetter = word.IsCorrect('p');

            // Assert
            Assert.IsTrue(isCorrectLetter);
        }
Exemple #4
0
        public void GenerateTargetWord_CheckReturnType_ReturnTrue()
        {
            // Arrange
            TargetWord    word         = new TargetWord();
            List <string> expectedList = word.TargetWordsList;

            // Act
            string randomWordGenerated = word.GenerateTargetWord();

            // Assert
            Assert.IsTrue(expectedList.Contains(randomWordGenerated));
        }
Exemple #5
0
        public override bool Equals(object other)
        {
            Word w = (Word)other;

            return(TargetWord.Equals(w.TargetWord) && WordType.Equals(w.WordType));
        }
Exemple #6
0
 public override int GetHashCode()
 {
     return(TargetWord.GetHashCode() + WordType.GetHashCode());
 }
Exemple #7
0
 public virtual int CompareTo(string other)
 {
     return(TargetWord.CompareTo(other));
 }
Exemple #8
0
 public virtual int CompareTo(Word other)
 {
     return(TargetWord.CompareTo(other.TargetWord) + WordType.CompareTo(other.WordType));
 }
Exemple #9
0
 public virtual int CompareTo(Symbol other)
 {
     return(TargetWord.CompareTo(other.TargetWord));
 }