예제 #1
0
        internal Cassette(ICasseteStorage storage, string name, RecordMode recordMode, IRequestMatcher requestMatcher)
        {
            _storage        = storage ?? throw new ArgumentNullException(nameof(storage));
            _name           = name ?? throw new ArgumentNullException(nameof(name));
            _requestMatcher = requestMatcher ?? throw new ArgumentNullException(nameof(requestMatcher));
            _recordMode     = recordMode;

            var httpInteractions = storage.Load(name);

            if (httpInteractions == null)
            {
                _isNew            = true;
                _httpInteractions = new List <HttpInteraction>();
            }
            else
            {
                _isNew            = false;
                _httpInteractions = httpInteractions;
            }
        }
예제 #2
0
파일: VCR.cs 프로젝트: epignosisx/vcr.net
 /// <summary>
 /// Cassette Storage to use.
 /// </summary>
 /// <param name="storage">Storage implementatino to use</param>
 public VCR(ICasseteStorage storage)
 {
     Storage = storage ?? throw new System.ArgumentNullException(nameof(storage));
 }