public void Init() { Inititialize(); _masterStub = Mocks.Stub<ISynchronizationAgent>(); _slaveMock = Mocks.StrictMock<ISynchronizationAgent>(); _propertyMap = new SynchronizationMap(_masterStub, _slaveMock); _synchronizer = new DataSynchronizer(_propertyMap, _masterStub, _slaveMock); }
public string GetMappedValue(ISynchronizationAgent agent, string value) { if (!_maps[agent].ContainsKey(value)) { throw new ArgumentException("Could not find value " + value); } return(_maps[agent][value]); }
public SynchronizationMap(ISynchronizationAgent fromAgent, ISynchronizationAgent toAgent) { _maps = new Dictionary <ISynchronizationAgent, Dictionary <string, string> >(); _map = new Dictionary <string, string>(); _reverseMap = new Dictionary <string, string>(); _maps.Add(fromAgent, _map); _maps.Add(toAgent, _reverseMap); }
public void Init() { Inititialize(); _masterStub = Mocks.Stub <ISynchronizationAgent>(); _slaveMock = Mocks.StrictMock <ISynchronizationAgent>(); var map = new SynchronizationMap(_masterStub, _slaveMock); map.AddReciprocalEntry("scheduled", "planned"); _synchronizer = new CreationSynchronizer(map, _masterStub, _slaveMock); }
private Dictionary <string, string> MapProperties(ISynchronizationAgent agent, Dictionary <string, string> properties) { var mappedProperties = new Dictionary <string, string>(); foreach (var keyValue in properties) { if (_propertyMap.ContainsKey(agent, keyValue.Key)) { mappedProperties.Add(_propertyMap.GetMappedValue(agent, keyValue.Key), keyValue.Value); } } return(mappedProperties); }
public void Init() { Inititialize(); _masterStub = Mocks.Stub <ISynchronizationAgent>(); _slaveMock = Mocks.StrictMock <ISynchronizationAgent>(); var map = new SynchronizationMap(_masterStub, _slaveMock); map.AddReciprocalEntry("/analysis", "Development"); map.AddReciprocalEntry("/done", "Done"); _synchronizer = new StatusSynchronizer(map, _masterStub, _slaveMock); }
private Dictionary <string, string> FilterForSynchronization(ISynchronizationAgent agent, IDictionary <string, string> properties) { var filteredProperties = new Dictionary <string, string>(); foreach (var propertyKey in _propertyMap.GetKeys(agent)) { if (properties.ContainsKey(propertyKey)) { filteredProperties.Add(propertyKey, properties[propertyKey]); } else { filteredProperties.Add(propertyKey, null); } } return(filteredProperties); }
public void Synchronize() { _eManagerAgent = CreateEManagerChangeRequestSynchronizationAgent(); _whiskWorkAgent = CreateWhiskWorkSynchronizationAgent(); var statusMap = CreateStatusMap(); SynchronizeExistence(statusMap); SynchronizeProperties(); if (SynchronizeResponsibleEnabled) { SynchronizeResponsible(); } SynchronizeStatus(statusMap); if(SynchronizeStatusReverseEnabled) { SynchronizeStatusReverse(statusMap); } }
public void Synchronize() { _eManagerAgent = CreateEManagerChangeRequestSynchronizationAgent(); _whiskWorkAgent = CreateWhiskWorkSynchronizationAgent(); var statusMap = CreateStatusMap(); SynchronizeExistence(statusMap); SynchronizeProperties(); if (SynchronizeResponsibleEnabled) { SynchronizeResponsible(); } SynchronizeStatus(statusMap); if (SynchronizeStatusReverseEnabled) { SynchronizeStatusReverse(statusMap); } }
private Dictionary<string, string> FilterForSynchronization(ISynchronizationAgent agent, IDictionary<string, string> properties) { var filteredProperties = new Dictionary<string, string>(); foreach (var propertyKey in _propertyMap.GetKeys(agent)) { if (properties.ContainsKey(propertyKey)) { filteredProperties.Add(propertyKey, properties[propertyKey]); } else { filteredProperties.Add(propertyKey, null); } } return filteredProperties; }
public DataSynchronizer(SynchronizationMap propertyMap, ISynchronizationAgent master, ISynchronizationAgent slave) { _propertyMap = propertyMap; _master = master; _slave = slave; }
public CreationSynchronizer(SynchronizationMap map, ISynchronizationAgent master, ISynchronizationAgent slave) { _map = map; _master = master; _slave = slave; }
public StatusSynchronizer(SynchronizationMap map, ISynchronizationAgent master, ISynchronizationAgent slave) { _map = map; _master = master; _slave = slave; }
public bool ContainsKey(ISynchronizationAgent agent, string value) { return(_maps[agent].ContainsKey(value)); }
public DataSynchronizer(SynchronizationMap propertyMap, ISynchronizationAgent master, ISynchronizationAgent slave) { _propertyMap = propertyMap; _master = master; _slave = slave; }
public IEnumerable <string> GetKeys(ISynchronizationAgent agent) { return(_maps[agent].Keys); }
private Dictionary<string, string> MapProperties(ISynchronizationAgent agent, Dictionary<string,string> properties) { var mappedProperties = new Dictionary<string, string>(); foreach (var keyValue in properties) { if(_propertyMap.ContainsKey(agent,keyValue.Key)) { mappedProperties.Add(_propertyMap.GetMappedValue(agent, keyValue.Key),keyValue.Value); } } return mappedProperties; }