예제 #1
0
        /// <summary>
        ///   Replays the next transition of the simulated counter example.
        /// </summary>
        private void Replay()
        {
            fixed(byte *sourceState = _states[_stateIndex - 1])
            _runtimeModel.Replay(sourceState, _counterExample.GetReplayInformation(_stateIndex - 1), initializationStep: _stateIndex == -1);

            var actualState = stackalloc byte[_runtimeModel.StateVectorSize];
            _runtimeModel.Serialize(actualState);

            if (IsCompleted && _counterExample.EndsWithException)
            {
                throw new InvalidOperationException(
                          "The path the counter example was generated for ended with an exception that could not be reproduced by the replay.");
            }

            EnsureStatesMatch(actualState, _states[_stateIndex]);
        }