Esempio n. 1
0
        public void TestIsIndetermined()
        {
            double a = 3;
            bool   respattesa = true, resp = Equazioni.IsIndetermined(a, b);

            Assert.AreEqual(respattesa, resp);
        }
Esempio n. 2
0
        public void TestIsIndetermined5()
        {
            double a = 0, b = -3;
            bool   RespAttesa = false;
            bool   Resp       = Equazioni.IsIndetermined(a, b);

            Assert.AreEqual(RespAttesa, Resp);
        }
Esempio n. 3
0
        public void TestIsIndetermined3()
        {
            double a = 0, b = 0;
            bool   RespAttesa = true;
            bool   Resp       = Equazioni.IsIndetermined(a, b);

            Assert.AreEqual(RespAttesa, Resp);
        }
Esempio n. 4
0
        public void Test_IsIndetermined2()
        {
            double b         = 1;
            double a         = 0;
            bool   Risultato = false;

            bool Risultato2 = Equazioni.IsIndetermined(a, b);

            Assert.AreEqual(Risultato, Risultato2);
        }
Esempio n. 5
0
        public void TestIndetermined5()
        {
            double a = -5, b = 0;

            bool respAspettata = false;

            bool resp = Equazioni.IsIndetermined(a, b);

            Assert.AreEqual(respAspettata, resp);
        }
 private void lblCalcola_Click(object sender, RoutedEventArgs e)
 {
     if (rdbDeterminata.IsChecked == true)
     {
         int  a        = int.Parse(txtA.Text);
         bool risposta = Equazioni.IsDetermined(a);
         if (risposta == true)
         {
             txtRisultato.Text = "L'equazione è Determinata";
         }
         else
         {
             txtRisultato.Text = "L'equazione non è Determinata";
         }
     }
     if (rdbInconsisted.IsChecked == true)
     {
         int  a        = int.Parse(txtA.Text);
         int  b        = int.Parse(txtB.Text);
         bool risposta = Equazioni.IsInconsisted(a, b);
         if (risposta == true)
         {
             txtRisultato.Text = "L'equazione è Impossibile";
         }
         else
         {
             txtRisultato.Text = "L'equazione non è Impossibile";
         }
     }
     if (rdbDegree2.IsChecked == true)
     {
         int  x        = int.Parse(txtX.Text);
         bool risposta = Equazioni.IsDegree2(x);
         if (risposta == true)
         {
             txtRisultato.Text = "Equazione di secondo grado";
         }
         else
         {
             txtRisultato.Text = "l'equazione non è di secondo grado";
         }
     }
     if (rdbDelta.IsChecked == true)
     {
         double a        = double.Parse(txtA.Text);
         double b        = double.Parse(txtB.Text);
         double c        = double.Parse(txtC.Text);
         double risposta = Equazioni.Delta(a, b, c);
         txtRisultato.Text = ($"{risposta}");
     }
     if (rdbIndetermined.IsChecked == true)
     {
         int  a        = int.Parse(txtA.Text);
         int  b        = int.Parse(txtB.Text);
         bool risposta = Equazioni.IsIndetermined(a, b);
         if (risposta == true)
         {
             txtRisultato.Text = "L'equazione è Indeterminata";
         }
         else
         {
             txtRisultato.Text = "L'equazione non è Indeterminata";
         }
     }
     if (rdbResult.IsChecked == true)
     {
         double a = double.Parse(txtA.Text);
         double b = double.Parse(txtB.Text);
         double c = double.Parse(txtC.Text);
         txtRisultato.Text = Equazioni.EquationDegree1(a, b, c);
     }
 }