public void Test_DI() { var expectedState = new CpuState(); var actualState = new CpuState { InterruptMasterEnable = true, ImeScheduled = true }; var memoryMock = new Mock <IRandomAccessMemory>(); var instruction = new DI(); instruction.Initialize(); //act while (!instruction.IsFetchNecessary()) { instruction.ExecuteCycle(actualState, memoryMock.Object); } TestHelper.AssertCpuState(expectedState, actualState); memoryMock.Verify(m => m.WriteByte(It.IsAny <ushort>(), It.IsAny <byte>()), Times.Never); }