Exemple #1
0
        public void SetBeside_WhereThreeNumberAreRight_test()
        {
            #region Arrange

            RandomNumber _randomNumber = new RandomNumber(1, 2, 3, 4);

            UserNumber _userNumber = new UserNumber(4, 3, 2, 5);

            EnteredNumber _enteredNumber = new EnteredNumber(_randomNumber, _userNumber);

            #endregion

            #region Assert

            Assert.IsTrue(_enteredNumber.Beside == "---");

            #endregion
        }
Exemple #2
0
        void OnTranslate(object sender, System.EventArgs e)
        {
            translatedNumber = PhonewordTranslator.ToNumber(EnteredNumber.Text);

            if (translatedNumber != null)
            {
                CallBtn.IsEnabled = true;
                CallBtn.Text      = string.Format("Call {0}", translatedNumber);
            }
            else
            {
                DisplayAlert("Phoneword", "The number entered is unsupported, Please re-enter a number", "OK");
                CallBtn.IsEnabled  = false;
                EnteredNumber.Text = string.Empty;
                CallBtn.Text       = "Call";
                EnteredNumber.Focus();
            }
        }
Exemple #3
0
        public void SetPrecisely_WhereAllNumbersAreRight_test()
        {
            #region Arrange

            RandomNumber _randomNumber = new RandomNumber();

            UserNumber _userNumber = new UserNumber(_randomNumber.FirstNumber.Value,
                                                    _randomNumber.SecondNumber.Value,
                                                    _randomNumber.ThirdNumber.Value,
                                                    _randomNumber.FourthNumber.Value);

            EnteredNumber _enteredNumber = new EnteredNumber(_randomNumber, _userNumber);

            #endregion

            #region Assert

            Assert.IsTrue(_enteredNumber.Precisely == "****");

            #endregion
        }
Exemple #4
0
 public void DisplayText()
 {
     squareText.GetComponent <Text>().text = EnteredNumber <= 0 ? " " : EnteredNumber.ToString();
 }
Exemple #5
0
 private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
 {
     EnteredNumber.Focus();
 }