Example #1
0
        public void Read_update_bitmask_instruction(string programInstruction, string expectedBitmaskDescription)
        {
            // Given
            var expectedBitMask = new BitMask(expectedBitmaskDescription);

            // When
            var actualMemory = InitializationProgramInterpreter.ExecuteInstruction(
                new Memory(new Memory.OverwriteStrategy()),
                programInstruction);

            // Then
            Assert.Equal(expectedBitMask, actualMemory.BitMask);
        }
Example #2
0
        public void Read_set_memory_instruction(string programInstruction, uint memoryPosition, long value)
        {
            // Given
            var expectedMemoryValue = new MemoryValue(value);

            // When
            var actualMemory = InitializationProgramInterpreter.ExecuteInstruction(
                new Memory(new Memory.OverwriteStrategy()),
                programInstruction);
            var actualMemoryValue = actualMemory.ValueAt(memoryPosition);

            // Then
            Assert.Equal(expectedMemoryValue, actualMemoryValue);
        }