Example #1
0
        public string GetFormula
            (ObservableCollection <string> IntegerStrings,
            string TotalIntegerValue)
        {
            FormulaText = AddFormula.GenerateFormula(this.IntegerStrings, TotalIntegerValue);

            return(FormulaText);
        }
Example #2
0
        private IUpdateUIState GetEnabledState
            (string Textbox1Text,
            string Textbox2Text,
            string TextboxTotalText)
        {
            if (Textbox1Text != null &&
                Textbox1Text.Length <= 0 &&
                Textbox2Text != null &&
                Textbox2Text.Length <= 0)
            {
                CurrentUIState = Textbox1And2BlankOrClearState;
                return(CurrentUIState);
            }

            if (Textbox1Text != null &&
                Textbox1Text.Length > 0 &&
                Textbox2Text != null &&
                Textbox2Text.Length > 0)
            {
                CurrentUIState = TextBoxOneAndTwoHaveValuesState;
            }
            else
            {
                CurrentUIState = TextBoxOneHasValueState;
            }

            CurrentUIState.StatusText = OkStatus.GetStatus();

            FormulaText = Formula.GenerateFormula
                              (FormulaStrings,
                              TextboxTotalText);

            CurrentUIState.FormulaText = FormulaText.Trim();

            return(CurrentUIState);
        }
        public void ConfirmThatLessThanOneValueIsInvalid()
        {
            FormulaValues.Clear();

            AddFormula.GenerateFormula(FormulaValues, TotalValue);
        }