Пример #1
0
        public void Inner_Stream_Calls_Dispose(bool disposeStream)
        {
            string key            = "test";
            var    mockStream     = new Mock <Stream>();
            var    mockProgress   = new Mock <IProgress <IWriteProgress> >();
            var    progressStream = new ProgressStream(key, mockStream.Object, null, mockProgress.Object, disposeStream);

            progressStream.Dispose();
        }
Пример #2
0
 public static void TestDoubleDispose()
 {
     using (Stream stream = Stream.Null)
     {
         Assert.DoesNotThrow(() =>
         {
             using (ProgressStream progressStream = new ProgressStream(stream, new ProgressContext()))
             {
                 progressStream.Dispose();
             }
         });
     }
 }