Пример #1
0
        public void ExecuteInContext(ManuallyPumpedSynchronizationContext context, Action <Advancer> action)
        {
            SynchronizationContext originalContext = SynchronizationContext.Current;

            try
            {
                SynchronizationContext.SetSynchronizationContext(context);
                Advancer advancer = new Advancer(actions, context);
                // This is where the tests assertions etc will go...
                action(advancer);
            }
            finally
            {
                SynchronizationContext.SetSynchronizationContext(originalContext);
            }
        }
Пример #2
0
 internal Advancer(SortedDictionary <int, Action> actions, ManuallyPumpedSynchronizationContext context)
 {
     this.actions = actions;
     this.context = context;
 }