Esempio n. 1
0
        public RecordedOutput Record(Action action)
        {
            _state = new RecordingState();

            action();

            var recordedOutput = new RecordedOutput(_state.RecordedContentType, _state.RecordedContent);

            _state = new NormalState();

            return(recordedOutput);
        }
        public RecordedOutput Record(Action action)
        {
            _state = new RecordingState();

            action();

            var recordedOutput = new RecordedOutput(_state.RecordedContentType, _state.RecordedContent);

            _state = new NormalState();

            return recordedOutput;
        }
Esempio n. 3
0
        public virtual IRecordedOutput Record(Action action)
        {
            var output = new RecordedOutput(_fileSystem);
            _state = output;

            try
            {
                action();
            }
            finally
            {
                revertToNormalWriting();
            }

            return output;
        }
Esempio n. 4
0
        public virtual IRecordedOutput Record(Action action)
        {
            var output = new RecordedOutput(_fileSystem);

            _state = output;

            try
            {
                action();
            }
            finally
            {
                revertToNormalWriting();
            }

            return(output);
        }
Esempio n. 5
0
 private void revertToNormalWriting()
 {
     _state = new NormalState(_writer, _fileSystem);
 }
Esempio n. 6
0
 private void revertToNormalWriting()
 {
     _state = new NormalState(_writer, _fileSystem);
 }