Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 public void DBModifierConstructorTest2()
 {
     DBModifier target = new DBModifier();
 }
Esempio n. 3
0
 public void DBModifierConstructorTest1()
 {
     DBModifier target = new DBModifier(new Dictionary<string, object>() {{"a",1},{"b",2},{"c",3}});
     target.Keys.Count.Should().Be(3);
 }
Esempio n. 4
0
 public void DBModifierConstructorTest()
 {
     DBModifier target = new DBModifier("a", 1);
     target["a"].Should().Be(1);
 }
Esempio n. 5
0
 public void AddToSetTest()
 {
     DBModifier target = new DBModifier();
     target.AddToSet("fieldName", "a");
     target.GetAsIDBObject(DBModifier.ModifierOperation.AddToSet)["fieldName"].Should().Be("a");
 }
Esempio n. 6
0
 public void PushTest()
 {
     DBModifier target = new DBModifier();
     target.Push("fieldName", "a");
     target.GetAsIDBObject(DBModifier.ModifierOperation.Push)["fieldName"].Should().Be("a");
 }
Esempio n. 7
0
 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);
 }
Esempio n. 8
0
        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);
        }
Esempio n. 9
0
 public void IncTest()
 {
     DBModifier target = new DBModifier();
     target.Inc("fieldName", 2);
     target.GetAsIDBObject(DBModifier.ModifierOperation.Inc)["fieldName"].Should().Be(2);
 }