public void AddedHandler_HandleMessage_DeserializsAndCallsCollectionManager() { var connectionMock = new Mock<IDdpConnectionSender>(); var collectionMock = new Mock<ICollectionManager>(); var resultHandlerMock = new Mock<IResultHandler>(); var testObject = new SimpleDdpObject {IsTrue = false}; var added = new Added {Collection = "Tests", Fields = JObject.FromObject(testObject),Id = "1"}; var handler = new AddedHandler(); handler.HandleMessage(connectionMock.Object, collectionMock.Object, resultHandlerMock.Object, JsonConvert.SerializeObject(added)); collectionMock.Verify(collection => collection.Added(It.IsAny<Added>()), Times.Once()); }
private void addExecute() { parent.MiscCosts.Add(ToAdd); Added?.Invoke(ToAdd); }
void Track_Add() => Added?.Invoke(_track.ParentIndex.Value + 1);
protected void Device_Add(Type device) => Added?.Invoke(_device.ParentIndex.Value + 1, device);
private void OnAdded(ValueAddedEventArgs args) { Added?.Invoke(this, args, Context); }
public void Add <T>(T entity) where T : class { Added.Add(entity); }
private void DoAddProp(IProp prop) { Added?.Invoke(this, new PropStoreEventArgs(new[] { prop })); }
public void IncludeAddedChange(IDependencyModel model) { Added.Add(model); }
protected virtual void OnAdded(TKey key, TValue value) { Added?.Invoke(key, value); }
protected virtual void OnGameSystemAdded(GameSystem gameSystem) { Added?.Invoke(gameSystem); }
/// <summary> /// Run the diff operation. Until this is called, all lists will be empty /// </summary> /// <returns>true if anything is different between index, tree, and workdir</returns> public bool Diff() { DirectoryInfo root = _index.Repository.WorkingDirectory; var visitor = new AbstractIndexTreeVisitor { VisitEntry = delegate(TreeEntry treeEntry, GitIndex.Entry indexEntry, FileInfo file) { if (treeEntry == null) { Added.Add(indexEntry.Name); _anyChanges = true; } else if (indexEntry == null) { if (!(treeEntry is Tree)) { Removed.Add(treeEntry.FullName); } _anyChanges = true; } else { if (!treeEntry.Id.Equals(indexEntry.ObjectId)) { Changed.Add(indexEntry.Name); _anyChanges = true; } } if (indexEntry != null) { if (!file.Exists) { Missing.Add(indexEntry.Name); _anyChanges = true; } else { if (indexEntry.IsModified(root, true)) { Modified.Add(indexEntry.Name); _anyChanges = true; } } } if (indexEntry != null) { if (indexEntry.Stage != 0) { MergeConflict.Add(indexEntry.Name); _anyChanges = true; } } } }; new IndexTreeWalker(_index, _tree, root, visitor).Walk(); CheckUntrackedDirectory(root.FullName, string.Empty); return(_anyChanges); }
protected virtual void OnAdded(ClinicAddedEventArgs e) { Added?.Invoke(this, e); }
public void Add(Key k, Value v) { elements.Add(k, v); Added?.Invoke(k, v); }
public void Add(object content) { Added.Add(content.ToString()); }
public void ExcludeAddedChange(IDependencyModel model) { Added.Remove(model); }
private void DoAdded(params TSectorEntity[] entities) { var args = new ManagerItemsChangedEventArgs <TSectorEntity>(entities); Added?.Invoke(this, args); }
/// <summary> /// Raises the Added event with the specified arguments. /// </summary> /// <param name="expression">Expression found in the cache.</param> /// <param name="delegate">Compiled delegate of the expression.</param> protected virtual void OnAdded(LambdaExpression expression, Delegate @delegate) => Added?.Invoke(this, new CacheEventArgs(expression, @delegate));
protected virtual void OnAdded(T item) { Added?.Invoke(this, item); }
/// <summary> /// Add new collision /// </summary> /// <param name="polygon"></param> public void Add(Polygon polygon) { Polygons.Add(polygon); Added?.Invoke(this, new AddedArgs(polygon, typeof(Light))); }
void AddContextMenu_Action(string action) => Added?.Invoke(Assembly.GetExecutingAssembly().GetType($"Apollo.Devices.{action.Replace(" ", "")}"));
void Given(Added e) => Value += e.Value;
public void DispatchAddEvent() { Added?.Invoke(this); }
public override string ToString() { return(Added.ToString("d") + ": " + Title + GetChanges()); }
/// <summary> /// Method to raise the added item event. /// </summary> /// <typeparam name="T">The <see cref="Type"/> of the <see cref="object"/></typeparam> /// <param name="entity">The new entity to paste into the event <see cref="EntityChangesEventArgs"/></param> protected void NotifyAdded <T>(T entity) where T : class { Added?.Invoke(this, new EntityChangesEventArgs(entity)); }
public bool Expired() { return((Added.Add(Expiry)) < DateTime.Now); }
protected void InvokeAdded() => Added?.Invoke();
public override string ToString() { return($"Added: {Added.ToCommaSeperatedList()} - Removed: {Removed.ToCommaSeperatedList()}"); }
public override string ToString() { return(string.Format("Added {0} items to and removed {1} items from '{2}'", Added.Count(), Removed.Count(), Property.Name)); }
protected virtual void OnAdded(EventArgs ea) => Added?.Invoke(this, ea);
public TEntity Add <TEntity>(TEntity entity) { Added?.Invoke(entity); return(entity); }
internal new void Add(IEvent Item) { base.Add(Item); Added.Add(Item); }