public void ModelTrackerCollection_ExistingCollection_AddRemoveModel_RemoveReturnsTrue() { var m = new TestModel(); Existing.Add(m); Assert.IsTrue(Existing.Remove(m)); }
public void ModelTrackerCollection_ExistingCollection_AddRemoveModel_ContainsModel_ReturnsFalse() { var m = new TestModel(); Existing.Add(m); Existing.Remove(m); Assert.IsFalse(Existing.Contains(m)); }
public void ModelTrackerCollection_ExistingCollection_AddRmoveModel_CountUnchanged() { var m = new TestModel(); var c = Existing.Count; Existing.Add(m); Existing.Remove(m); Assert.AreEqual(Existing.Count, c); }
public void ModelTrackerCollection_ExistingCollection_RemoveModel_EventInvoked() { var m = Existing.Skip(1).First(); bool removed = false; Existing.ModelRemovedEvent += (s, e) => { Assert.AreEqual(m.Data, e.Model.Data); Assert.AreEqual(m.Id, e.Model.Id); removed = true; }; Existing.Remove(m.Id); Assert.IsTrue(removed); }