Example #1
0
        public void Roundtrip_immediate_value_2()
        {
            var memory = new MemoryBank();

            memory.SetValue(0, 99, ParameterMode.Immediate);
            Assert.AreEqual(99, memory.GetValue(0, ParameterMode.Immediate));
        }
Example #2
0
        public void Roundtrip_positional_value_2()
        {
            var memory = new MemoryBank();

            memory.SetValueImmediate(0, 1);
            memory.SetValue(0, 99, ParameterMode.Position);
            Assert.AreEqual(99, memory.GetValue(0, ParameterMode.Position));
        }
Example #3
0
        public void SetValue_with_invalid_parametermode_should_throw()
        {
            var memory = new MemoryBank();

            Assert.Throws <InvalidEnumArgumentException>(() => memory.SetValue(0, 1, (ParameterMode)100));
        }