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

            memory.Clear();
            TMemory <TFrac> .NumStates expected = TMemory <TFrac> .NumStates.OFF;
            Assert.AreEqual(expected, memory.FState);
        }
예제 #2
0
        public void TestMethodClear()
        {
            TMemory <Frac> f = new TMemory <Frac>();

            f.WriteMemory(new Frac(5, 6));
            var otvet = new Frac(5, 6);

            Assert.AreEqual(otvet.Denominator, f.ReadNumber().Denominator);
            Assert.AreEqual(otvet.Numerator, f.ReadNumber().Numerator);

            f.Clear();

            otvet = new Frac();
            Assert.AreEqual(otvet.Denominator, f.ReadNumber().Denominator);
            Assert.AreEqual(otvet.Numerator, f.ReadNumber().Numerator);
        }