コード例 #1
0
        public Model.WordState State(CryptoRandom rand)
        {
            CryptoRandom r = rand;
            int val;
            WordState w = new WordState();
            Word word = _automat.word;
            int max = AppSettings.GetSound() ? 3 : 2;
            val = r.Next(0, max);
            switch(val)
            {
                case 0:
                    w.Rus();
                    break;
                case 1:
                    w.Eng();
                    break;
                case 2:
                    w.Sound();
                    break;
            }

            w.Text(word.EWord, word.Transcription, word.EPhrase, word.RWord, word.RPhrase);
            if (_automat.word.WordId != -1)
                w.ButtonState();
            else
                w.WithoutButtonState();
            return w;
        }
コード例 #2
0
 public void SoundTest()
 {
     WordState w = new WordState();
     w.Sound();
     Assert.AreEqual(w.R, false);
     Assert.AreEqual(w.E, false);
     Assert.AreEqual(w.S, true);
 }