Exemplo n.º 1
0
 public void GetData(TaskNum task)
 {
     task.numbers.Add(new RationalNumber(7, 1));
     task.numbers.Add(new RationalNumber(8, 1));
     task.numbers.Add(new RationalNumber(9, 1));
     task.numbers.Add(new RationalNumber(7, 8));
     task.numbers.Add(new RationalNumber(9, 10));
 }
Exemplo n.º 2
0
        public void CloneTestMethod()
        {
            TaskNum task = new TaskNum();

            GetData(task);
            TaskNum cloneTask = task.Clone() as TaskNum;

            Assert.AreEqual(task.numbers.Count, cloneTask.numbers.Count);
        }
Exemplo n.º 3
0
        public void DobutokTestMethod()
        {
            TaskNum task = new TaskNum();

            GetData(task);
            RationalNumber res = task.Dobutok() as RationalNumber;

            RationalNumber expetedRes = new RationalNumber(3969, 10);

            Assert.IsTrue(expetedRes.denominator == res.denominator && res.numerator == expetedRes.numerator);
        }
Exemplo n.º 4
0
        public void AverageTestMethod()
        {
            TaskNum task = new TaskNum();

            GetData(task);
            RationalNumber res = task.Average() as RationalNumber;

            RationalNumber expetedRes = new RationalNumber(1031, 200);

            Assert.IsTrue(expetedRes.denominator == res.denominator && res.numerator == expetedRes.numerator);
        }
Exemplo n.º 5
0
 private void SetTask()
 {
     lblTask.Text = "Task " + TaskNum.ToString() + "/" + TaskCount.ToString() + ": " + TaskName + "...";
     Refresh();
 }