public void AddTest2() { DBObjectArray target = new DBObjectArray(); DBObject a = new DBObject("add", "me"); target.Add(new KeyValuePair<string, object>("0", a)); new Action(() => target.Add(new KeyValuePair<string, object>("a", a))).ShouldThrow<Exception>(); target.Count.Should().Be(1); }
public void AddTest1() { DBObjectArray target = new DBObjectArray(); DBObject a = new DBObject("add", "me"); target.Add("0", a); target.Count.Should().Be(1); new Action(() => target.Add("a", a)).ShouldThrow<ArgumentException>("index/key must be numeric"); }
public void AddTest3() { IList target = new DBObjectArray() as IList; DBObject a = new DBObject("add", "me"); target.Add(a); target.Count.Should().Be(1); }