Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
 public void ButtonStateTest()
 {
     WordState w = new WordState();
     w.ButtonState();
     Assert.AreEqual(w.Button1, "Не помню");
     Assert.AreEqual(w.Button2, "Помню");
     Assert.AreEqual(w.B1, true);
     Assert.AreEqual(w.B2, true);
 }