Ejemplo n.º 1
0
        public void RegisterIndexIsSetProperty(int regIndex)
        {
            // --- Arrange
            var spectrum = new SpectrumSoundTestMachine();
            var soundDev = new SoundDevice();

            soundDev.OnAttachedToVm(spectrum);

            // --- Act
            soundDev.SetRegisterIndex((byte)regIndex);

            // --- Assert
            soundDev.LastRegisterIndex.ShouldBe((byte)regIndex);
        }
Ejemplo n.º 2
0
        public void DeviceIsInitializedProperty()
        {
            // --- Arrange
            var spectrum = new SpectrumSoundTestMachine();

            // --- Act
            var soundDev = new SoundDevice();

            soundDev.OnAttachedToVm(spectrum);

            // --- Assert
            soundDev.LastRegisterIndex.ShouldBe((byte)0);
            for (var i = 0; i <= 0x0F; i++)
            {
                soundDev.PsgState[i].ShouldBe((byte)0);
            }
            soundDev.FrameCount.ShouldBe(0);
            soundDev.LastSampleTact.ShouldBe(0);
            soundDev.AudioSamples.Length.ShouldBe(1108);
        }