public virtual void TestHashSetOfString() { Object obj = ""; ISet <String> coll = new HashSet <String>(); MethodInfo addMethod = coll.GetType().GetMethod("Add", new Type[] { typeof(String) }); fixture = new CollectionSetterCommand(); fixture.ObjectFuture = null; fixture.Parent = coll; fixture.AddMethod = addMethod; fixture.Obj = obj; fixture.AfterPropertiesSet(); fixture.Execute(null); Assert.AreEqual(1, coll.Count); Assert.AreEqual(obj, coll.ElementAt(0)); }
public virtual void testArrayList() { Object obj = ""; IList coll = new ArrayList(); MethodInfo addMethod = coll.GetType().GetMethod("Add", new Type[] { typeof(Object) }); fixture = new CollectionSetterCommand(); fixture.ObjectFuture = null; fixture.Parent = coll; fixture.AddMethod = addMethod; fixture.Obj = obj; fixture.AfterPropertiesSet(); fixture.Execute(null); Assert.AreEqual(1, coll.Count); Assert.AreEqual(obj, coll[0]); }