public void TestGetMultiples()
        {
            // Arrange
            ulong expectedResult  = 8;
            ulong expectedResult2 = 234168;

            // Act
            ulong actualResult  = mobidiagAppViewModel.GetTotalMutiple("5");
            ulong acutalResult2 = mobidiagAppViewModel.GetTotalMutiple("1000");

            // Assert
            Assert.Equal(expectedResult, actualResult);
            Assert.Equal(expectedResult2, acutalResult2);
        }
Ejemplo n.º 2
0
        private void Btn_Click(object sender, RoutedEventArgs e)
        {
            string name = (sender as Button).Name.ToString();

            if (string.Equals(name, "BtnTotalMutiple"))
            {
                TbResult.Text = string.Format("{0}'s sum of multiples of all 3 or 5 is: {1}",
                                              mobidiagAppViewModel.GetTotalMutipleInput(TbInput.Text),
                                              mobidiagAppViewModel.GetTotalMutiple(TbInput.Text));
            }
            else if (string.Equals(name, "BtnFibSum"))
            {
                TbResult.Text = string.Format("{0} Fibonacci sequence even number summation is: {1}",
                                              mobidiagAppViewModel.GetFibSumIput(TbInput.Text),
                                              mobidiagAppViewModel.GetSumOfFibEvenNumber(TbInput.Text));
            }
            else if (string.Equals(name, "BtnPrimeNumber"))
            {
                TbResult.Text = string.Format("{0}'s largest prime factor number is: {1}",
                                              mobidiagAppViewModel.GetPrimeInput(TbInput.Text),
                                              mobidiagAppViewModel.GetLargestPrime(TbInput.Text));
            }
            TbInput.Text = "";
        }