private void findMatchingButtons(int pos)
        {
            bool isMatch = false;

            if (mostRecentClick == null)
            {
                mostRecentClick = buttons[pos].Text;
            }

            else
            {
                //I can't tell whether my string is a key or value, so I'll have to check both combinations
                if (hiragana.compareKeyAndValue(mostRecentClick, buttons[pos].Text) || hiragana.compareKeyAndValue(buttons[pos].Text, mostRecentClick))
                {
                    isMatch = true;
                }
            }

            if (isMatch)
            {
                buttons[pos].BackColor = System.Drawing.Color.FromArgb(155, 155, 155);
                foreach (var button in buttons)
                {
                    if (button.Text.Equals(mostRecentClick))
                    {
                        button.BackColor = System.Drawing.Color.FromArgb(155, 155, 155);
                    }
                }
            }

            mostRecentClick = buttons[pos].Text;
        }
Example #2
0
        public void compareKeyAndValue_incorrectComparison_returnsFalse()
        {
            //Arrange
            HiraganaCharacters hiragana = new HiraganaCharacters();

            //Act

            var result = hiragana.compareKeyAndValue("も", "moada");

            //Assert
            Assert.IsNotNull(result);
            Assert.IsFalse(result);
        }