Example #1
0
 public void MovingTest()
 {
     const int memorySize = 100;
     var engine = new Engine(memorySize);
     engine.Add();
     for (int i = 0; i < memorySize; ++i)
     {
         engine.Forward();
     }
     Assert.AreEqual(engine.Get(), 1);
 }
Example #2
0
 public void DataTest()
 {
     const int iterations = 100;
     var engine = new Engine(1);
     for (int i = 0; i < iterations; ++i)
     {
         engine.Add();
         Assert.AreEqual(engine.Get(), i + 1);
     }
     for (int i = 0; i < iterations; ++i)
     {
         engine.Dec();
         Assert.AreEqual(engine.Get(), iterations - i - 1);
     }
     Assert.AreEqual(engine.Get(), 0);
 }