public void Remove() { BindingContextPoker p = new BindingContextPoker(); object data_source = new object(); p.collection_changed = -1; p._Add(data_source, new PropertyManager()); Assert.IsTrue(p.Contains(data_source), "REMOVE1"); Assert.AreEqual(1, ((ICollection)p).Count, "REMOVE2"); Assert.AreEqual(p.collection_changed, (int)CollectionChangeAction.Add, "REMOVE3"); p._Remove(data_source); Assert.IsFalse(p.Contains(data_source), "REMOVE4"); Assert.AreEqual(0, ((ICollection)p).Count, "REMOVE5"); Assert.AreEqual(p.collection_changed, (int)CollectionChangeAction.Remove, "REMOVE6"); // Double remove p.collection_changed = -1; p._Remove(data_source); Assert.IsFalse(p.Contains(data_source), "REMOVE7"); Assert.AreEqual(0, ((ICollection)p).Count, "REMOVE8"); Assert.AreEqual(p.collection_changed, (int)CollectionChangeAction.Remove, "REMOVE9"); }
public void TestContainsNull() { BindingContextPoker p = new BindingContextPoker(); p.Contains(null); }
public void RemoveNull() { BindingContextPoker p = new BindingContextPoker(); p._Remove(null); }
public void AddNullListManager() { BindingContextPoker p = new BindingContextPoker(); p._Add(new object(), null); }
public void AddNullDataSource() { BindingContextPoker p = new BindingContextPoker(); p._Add(null, new PropertyManager()); }
public void TestGetEnumerator () { BindingContextPoker p = new BindingContextPoker (); object data_source = new object (); PropertyManager pm = new PropertyManager (); p._Add (data_source, pm); IEnumerator e = ((IEnumerable) p).GetEnumerator (); Assert.IsNotNull (e, "#1"); IDictionaryEnumerator de = e as IDictionaryEnumerator; Assert.IsNotNull (de, "#2"); Assert.IsTrue (de.MoveNext (), "#3"); // In .NET Key is its internal type. //Assert.AreEqual (data_source, de.Key, "#4"); //Assert.AreEqual (pm, de.Value, "#5"); Assert.IsFalse (de.MoveNext (), "#6"); }
public void TestContainsNull2 () { BindingContextPoker p = new BindingContextPoker (); object data_source = new object (); p._Add (data_source, new PropertyManager ()); Assert.IsTrue (p.Contains (data_source, null), "#1"); Assert.IsFalse (p.Contains ("nonexistent", null), "#2"); }
public void TestContainsNull () { BindingContextPoker p = new BindingContextPoker (); p.Contains (null); }
public void ClearCore () { BindingContextPoker p = new BindingContextPoker (); object data_source = new object (); p._Add (data_source, new PropertyManager ()); p.collection_changed = -1; p._Clear (); Assert.IsFalse (p.Contains (data_source), "CLEARCORE1"); Assert.AreEqual (0, ((ICollection) p).Count, "CLEARCORE2"); Assert.AreEqual (p.collection_changed, (int) CollectionChangeAction.Refresh, "CLEARCORE3"); // Double clear p.collection_changed = -1; p._Clear (); Assert.IsFalse (p.Contains (data_source), "CLEARCORE4"); Assert.AreEqual (0, ((ICollection) p).Count, "CLEARCORE5"); Assert.AreEqual (p.collection_changed, (int) CollectionChangeAction.Refresh, "CLEARCORE6"); }
public void RemoveCore () { BindingContextPoker p = new BindingContextPoker (); object data_source = new object (); p.collection_changed = -1; p._Add (data_source, new PropertyManager ()); Assert.IsTrue (p.Contains (data_source), "REMOVECORE1"); Assert.AreEqual (1, ((ICollection) p).Count, "REMOVECORE2"); Assert.AreEqual (p.collection_changed, (int) CollectionChangeAction.Add, "REMOVECORE3"); p.collection_changed = -1; p._RemoveCore (data_source); Assert.IsFalse (p.Contains (data_source), "REMOVECORE4"); Assert.AreEqual (0, ((ICollection) p).Count, "REMOVECORE5"); Assert.AreEqual (p.collection_changed, -1, "REMOVECORE6"); // Double remove p.collection_changed = -1; p._Remove (data_source); Assert.IsFalse (p.Contains (data_source), "REMOVECORE7"); Assert.AreEqual (0, ((ICollection) p).Count, "REMOVECORE8"); Assert.AreEqual (p.collection_changed, (int) CollectionChangeAction.Remove, "REMOVECORE9"); }
public void RemoveNull () { BindingContextPoker p = new BindingContextPoker (); p._Remove (null); }
public void AddCore () { BindingContextPoker p = new BindingContextPoker (); object data_source = new object (); p.collection_changed = -1; Assert.IsFalse (p.Contains (data_source), "ADDCORE1"); Assert.AreEqual (0, ((ICollection) p).Count, "ADDCORE2"); p._AddCore (data_source, new PropertyManager ()); Assert.IsTrue (p.Contains (data_source), "ADDCORE3"); Assert.AreEqual (1, ((ICollection) p).Count, "ADDCORE4"); Assert.AreEqual (p.collection_changed, -1, "ADDCORE5"); p.collection_changed = -1; p._AddCore (data_source, new PropertyManager ()); Assert.IsTrue (p.Contains (data_source), "ADDCORE6"); Assert.AreEqual (1, ((ICollection) p).Count, "ADDCORE7"); Assert.AreEqual (p.collection_changed, -1, "ADDCORE8"); p.collection_changed = -1; data_source = new object (); p._AddCore (data_source, new PropertyManager ()); Assert.IsTrue (p.Contains (data_source), "ADDCORE9"); Assert.AreEqual (2, ((ICollection) p).Count, "ADDCORE10"); Assert.AreEqual (p.collection_changed, -1, "ADDCORE11"); }
public void Add () { BindingContextPoker p = new BindingContextPoker (); object data_source = new object (); p.collection_changed = -1; Assert.IsFalse (p.Contains (data_source), "ADD1"); Assert.AreEqual (0, ((ICollection) p).Count, "ADD2"); p._Add (data_source, new PropertyManager ()); Assert.IsTrue (p.Contains (data_source), "ADD3"); Assert.AreEqual (1, ((ICollection) p).Count, "ADD4"); Assert.AreEqual (p.collection_changed, (int) CollectionChangeAction.Add, "ADD5"); p.collection_changed = -1; p._Add (data_source, new PropertyManager ()); Assert.IsTrue (p.Contains (data_source), "ADD6"); Assert.AreEqual (1, ((ICollection) p).Count, "ADD7"); Assert.AreEqual (p.collection_changed, (int) CollectionChangeAction.Add, "ADD8"); p.collection_changed = -1; data_source = new object (); p._Add (data_source, new PropertyManager ()); Assert.IsTrue (p.Contains (data_source), "ADD9"); Assert.AreEqual (2, ((ICollection) p).Count, "ADD10"); Assert.AreEqual (p.collection_changed, (int) CollectionChangeAction.Add, "ADD9"); }
public void AddNullListManager () { BindingContextPoker p = new BindingContextPoker (); p._Add (new object (), null); }
public void AddNullDataSource () { BindingContextPoker p = new BindingContextPoker (); p._Add (null, new PropertyManager ()); }