Beispiel #1
0
        public void TestFState3()
        {
            TFrac           frac   = new TFrac(8, 9);
            TMemory <TFrac> memory = new TMemory <TFrac>(frac);

            memory.Add(frac);
            TMemory <TFrac> .NumStates expected = TMemory <TFrac> .NumStates.ON;
            Assert.AreEqual(expected, memory.FState);
        }
Beispiel #2
0
        public void Sum2()
        {
            TFrac           frac     = new TFrac(8, 9);
            TMemory <TFrac> memory   = new TMemory <TFrac>(frac);
            TFrac           summator = new TFrac(-16, 3);

            memory.Add(summator);
            string answer = "-40/9";

            Assert.AreEqual(answer, memory.FNumber.ToString());
        }
Beispiel #3
0
        public void Sum1()
        {
            TFrac           frac     = new TFrac(-1, 5);
            TMemory <TFrac> memory   = new TMemory <TFrac>(frac);
            TFrac           summator = new TFrac(1, 2);

            memory.Add(summator);
            string answer = "3/10";

            Assert.AreEqual(answer, memory.FNumber.ToString());
        }