Example #1
0
 public void AddCasted()
 {
     var toCheck = new AssertDisposable();
     object toAdd = toCheck;
     var toTest = new Disposer();
     toTest.AddIfDisposable(toAdd);
     toTest.Dispose();
     toCheck.AssertDisposed();
 }
Example #2
0
        public void AddCasted()
        {
            var    toCheck = new AssertDisposable();
            object toAdd   = toCheck;
            var    toTest  = new Disposer();

            toTest.AddIfDisposable(toAdd);
            toTest.Dispose();
            toCheck.AssertDisposed();
        }
Example #3
0
        public void ExpectDisposes()
        {
            var dsp1   = new AssertDisposable();
            var dsp2   = new AssertDisposable();
            var dsp3   = new AssertDisposable();
            var toTest = new Disposer();

            toTest.Add(dsp1);
            toTest.Add(dsp2);
            toTest.Add(dsp3);
            toTest.Dispose();
            dsp1.AssertDisposed();
            dsp2.AssertDisposed();
            dsp3.AssertDisposed();
        }
Example #4
0
 public void ExpectDisposes()
 {
     var dsp1 = new AssertDisposable();
     var dsp2 = new AssertDisposable();
     var dsp3 = new AssertDisposable();
     var toTest = new Disposer();
     toTest.Add(dsp1);
     toTest.Add(dsp2);
     toTest.Add(dsp3);
     toTest.Dispose();
     dsp1.AssertDisposed();
     dsp2.AssertDisposed();
     dsp3.AssertDisposed();
 }