public void ShouldIncreaseHighPosition()
        {
            StoragePosition position = new StoragePosition();

            position.Increase(100);

            Assert.That(position.High, Is.EqualTo(100));
        }
        public void ShouldIncreaseLowPosition()
        {
            StoragePosition position = new StoragePosition();

            position.Increase(100);
            position.Decrease(50);

            Assert.That(position.Low, Is.EqualTo(50));
        }
Beispiel #3
0
        public void ShouldHaveRequestedPosition()
        {
            Memory          memory   = new Memory(1024);
            StoragePosition position = new StoragePosition();

            position.Increase(300);
            StorageAllocation allocation = new StorageAllocation(memory, position);

            Assert.That(allocation.Position, Is.EqualTo(300));
        }
Beispiel #4
0
        public void ShouldWriteToAllocatedPosition()
        {
            Memory          memory   = new Memory(1024);
            StoragePosition position = new StoragePosition();

            position.Increase(300);
            StorageAllocation allocation = new StorageAllocation(memory, position);

            allocation.Set(12, 23);
            Assert.That(memory.Get(312), Is.EqualTo(23));
        }
Beispiel #5
0
 public void Commit(int size)
 {
     position.Increase(size);
 }