Exemplo n.º 1
0
        public void ShouldIncreaseHighPosition()
        {
            StoragePosition position = new StoragePosition();

            position.Increase(100);

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

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

            Assert.That(position.Low, Is.EqualTo(50));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 5
0
 public void Commit(int size)
 {
     position.Increase(size);
 }