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)); }
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); } }
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); } }
public void AddSyncAction(ISynchronizationAction <T> action) { _synchActions.Add(action); }
/* * 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()); }
public void AddSyncAction(ISynchronizationAction <T> action) { _decorated.AddSyncAction(action); }