Пример #1
0
        public void Calculate_Value_Of_Phrase_With_Non_Hebrew_Chars()
        {
            GemateriaCalculator calc = new GemateriaCalculator();
            long calculatedValue     = calc.CalculateGemateria(basicPhraseWithNonHebrewChars);

            Assert.AreEqual(basic, calculatedValue);
        }
Пример #2
0
        public void Calculate_Value_Of_Phrase_Basic()
        {
            GemateriaCalculator calc = new GemateriaCalculator();
            long calculatedValue     = calc.CalculateGemateria(hebrewPhrase);

            Assert.AreEqual(basic, calculatedValue);
        }
Пример #3
0
        public void Calculate_Value_Of_Phrase_Basic_With_Kollel()
        {
            GemateriaCalculator calc = new GemateriaCalculator()
            {
                WithKollel = true
            };
            long calculatedValue = calc.CalculateGemateria(hebrewPhraseWithMoreThanOneConsecutiveSpace);

            Assert.AreEqual(basicWithKollel, calculatedValue);
        }
Пример #4
0
        public void Calculate_Value_Of_Phrase_Mispar_Kuten()
        {
            GemateriaCalculator calc = new GemateriaCalculator()
            {
                IsMisparKuten = true
            };
            long calculatedValue = calc.CalculateGemateria(hebrewPhrase);

            Assert.AreEqual(misparKuten, calculatedValue);
        }
Пример #5
0
        public void Calculate_Value_Of_Phrase_Mispar_Kuten_With_Kollel()
        {
            GemateriaCalculator calc = new GemateriaCalculator()
            {
                WithKollel    = true,
                IsMisparKuten = true
            };
            long calculatedValue = calc.CalculateGemateria(hebrewPhraseWithMoreThanOneConsecutiveSpace);

            Assert.AreEqual(misparKutenWithKollel, calculatedValue);
        }
Пример #6
0
        public void Reset_Button()
        {
            GemateriaCalculator calc = new GemateriaCalculator()
            {
                WithKollel    = true,
                IsMisparKuten = true
            };

            calc.Reset();
            Assert.IsFalse(calc.WithKollel);
            Assert.IsFalse(calc.IsMisparKuten);
        }
Пример #7
0
        public void Get_All_Equal_Words_From_Torah_Test()
        {
            int sum = 10;
            GemateriaFromTorahCalculator torahFinder = new GemateriaFromTorahCalculator();
            IEnumerable <string>         result      = torahFinder.GetAllGematrios(sum);

            Assert.IsTrue(result.Any());
            foreach (var str in result)
            {
                long total = new GemateriaCalculator().CalculateGemateria(str);
                Assert.AreEqual(sum, (int)total);
            }
        }
        public string ConvertHebrewTextToNumericValue(string hebrewText)
        {
            var gemateriaCalc = new GemateriaCalculator();

            hebrewText = hebrewText.Replace("\n", " ");
            var        words          = hebrewText.Split(" ", StringSplitOptions.RemoveEmptyEntries);
            List <int> wordsAsNumbers = new List <int>();
            string     numbersAsText  = "";

            foreach (var word in words)
            {
                wordsAsNumbers.Add((int)gemateriaCalc.CalculateGemateria(word));
            }

            foreach (var number in wordsAsNumbers)
            {
                numbersAsText += number + " ";
            }
            numbersAsText = numbersAsText.Remove(numbersAsText.Length - 1);
            return(numbersAsText);
        }
Пример #9
0
 public MainWindow()
 {
     InitializeComponent();
     gemateriaCalculator = new GemateriaCalculator();
     hebrewPhrase        = "";
 }