public void AllocationTest() { const int memorySize = 100; var engine = new Engine(memorySize); Assert.AreEqual(engine.Get(), 0); for (int i = 0; i < memorySize; ++i) { engine.Forward(); Assert.AreEqual(engine.Get(), 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); }
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); }