Пример #1
0
        public static Scope Begin()
        {
            var sync = new UnitTestSynchronizationContext();
            var old  = SynchronizationContext.Current;

            SynchronizationContext.SetSynchronizationContext(sync);
            return(new Scope(old, sync));
        }
Пример #2
0
 public Scope(SynchronizationContext old, UnitTestSynchronizationContext n)
 {
     _old = old;
     _new = n;
 }