public void AddEachToSetTest() { DBModifier target = new DBModifier(); ArrayList list = new ArrayList() {"a", "b", "c" }; target.AddEachToSet("fieldName", list); target.GetAsIDBObject(DBModifier.ModifierOperation.AddToSet).GetAsIDBObject("fieldName")[DBModifier.ModifierOperation.Each].Should().Be(list); }
public void DBModifierConstructorTest2() { DBModifier target = new DBModifier(); }
public void DBModifierConstructorTest1() { DBModifier target = new DBModifier(new Dictionary<string, object>() {{"a",1},{"b",2},{"c",3}}); target.Keys.Count.Should().Be(3); }
public void DBModifierConstructorTest() { DBModifier target = new DBModifier("a", 1); target["a"].Should().Be(1); }
public void AddToSetTest() { DBModifier target = new DBModifier(); target.AddToSet("fieldName", "a"); target.GetAsIDBObject(DBModifier.ModifierOperation.AddToSet)["fieldName"].Should().Be("a"); }
public void PushTest() { DBModifier target = new DBModifier(); target.Push("fieldName", "a"); target.GetAsIDBObject(DBModifier.ModifierOperation.Push)["fieldName"].Should().Be("a"); }
public void PushAllTest() { DBModifier target = new DBModifier(); ArrayList list = new ArrayList() { "a", "b", "c" }; target.PushAll("fieldName", list); target.GetAsIDBObject(DBModifier.ModifierOperation.PushAll)["fieldName"].Should().Be(list); }
public void PopTest() { DBModifier target = new DBModifier(); target.Pop("fieldName", false); target.GetAsIDBObject(DBModifier.ModifierOperation.Pop)["fieldName"].Should().Be(-1); target = new DBModifier(); target.Pop("fieldName", true); target.GetAsIDBObject(DBModifier.ModifierOperation.Pop)["fieldName"].Should().Be(1); }
public void IncTest() { DBModifier target = new DBModifier(); target.Inc("fieldName", 2); target.GetAsIDBObject(DBModifier.ModifierOperation.Inc)["fieldName"].Should().Be(2); }