public void SetUpTest()
 {
     _stepUnderTest    = new ChangeDispatchingStep <LocalTestResource>();
     _testActionResult = new SynchronizationResult(true);
     _testAction       = new SynchronizationAction <LocalTestResource, string>("bogus",
                                                                               (resource, s) => _testActionResult, new LocalTestResource(1));
 }
 public void SetUpTest()
 {
     _stepUnderTest = new ChangeDispatchingStep<LocalTestResource>();
     _testActionResult = new SynchronizationResult(true);
     _testAction = new SynchronizationAction<LocalTestResource, string>("bogus",
         (resource, s) => _testActionResult, new LocalTestResource(1));
 }
예제 #3
0
 private static void OnNext(ISynchronizationAction <T> action)
 {
     try
     {
         action.Execute();
         // Could also added interceptor on this.
         Debug.WriteLine(action);
     }
     catch (Exception ex)
     {
         Debug.WriteLine(action + " Failed with message " + ex.Message);
     }
 }
예제 #4
0
 public override SynchronizationResult Process(ISynchronizationAction <TItem> action)
 {
     try
     {
         return(action.Execute());
     }
     catch (Exception ex)
     {
         // Error handling scenario's/needs, which currently don't need support for yet.
         // * Rollback a transaction.
         // * Log the error.
         // * Swallow the exception and just continue.
         // * Add information to the catched/rethrown exception?
         throw new DispatchingException($"Failed executing action {action.Name} on {action.Applicant}!", ex);
     }
 }
예제 #5
0
 public void AddSyncAction(ISynchronizationAction <T> action)
 {
     _synchActions.Add(action);
 }
예제 #6
0
        /*
         * public ISynchronizationAction<TSynch> ChangeResolver([NotNull] TSynch item)
         * {
         *  if (item == null) {  throw new ArgumentNullException(nameof(item)); }
         *
         *  // TODO: Error handling?
         *  //return _channelConfig.SynchronizationResolvers.FirstOrDefault(action => action.AppliesTo(item)) ?? new NullSynchAction<TSynch>();
         *  // Injecting NullSynchActions provides means of logging
         * }
         */

        public SynchronizationResult Dispatcher(ISynchronizationAction <TSynch> synchAction)
        {
            // TODO: Error handling
            return(synchAction.Execute());
        }
예제 #7
0
 public void AddSyncAction(ISynchronizationAction <T> action)
 {
     _decorated.AddSyncAction(action);
 }