public void it_build_set_array_doc_query() { var updater = new MongoUpdateBuilder<TestDocument>(); var doc = new ItemDocument() { Value = 5 }; updater.Set(x => x.Items[It.IsAny<int>()], doc); Assert.AreEqual(updater.ResultQuery.ToString(), Update.Set("Items.$", doc.ToBsonDocument()).ToString()); }
public void test() { var updater = new MongoUpdateBuilder<TestDocument>(); var doc = new ItemDocument() { Value = 5 }; updater.Set(x => x.Name, "Name").Set(x => x.InnerDoc, doc); Assert.AreEqual(updater.ResultQuery.ToString(), Update.Set("Name", "Name").Set("InnerDoc", doc.ToBsonDocument()).ToString()); }
public void it_build_set_array_value_query() { var updater = new MongoUpdateBuilder<TestDocument>(); updater.Set(x => x.Srtings[It.IsAny<int>()], "Value"); Assert.AreEqual(updater.ResultQuery.ToString(), Update.Set("Srtings.$", "Value").ToString()); }
public void it_build_set_array_positionaly_query() { var updater = new MongoUpdateBuilder<TestDocument>(); updater.Set(x => x.Items[101].Value, 5); Assert.AreEqual(updater.ResultQuery.ToString(), Update.Set("Items.101.Value", 5).ToString()); }
public void it_build_set_array_inner_query() { var updater = new MongoUpdateBuilder<TestDocument>(); updater.Set(x => x.Items[It.IsAny<int>()].Value, 5); Assert.AreEqual(updater.ResultQuery.ToString(), Update.Set("Items.$.Value", 5).ToString()); }
public void it_build_set_query() { var updater = new MongoUpdateBuilder<TestDocument>(); updater.Set(x => x.Name, "Name"); Assert.AreEqual(updater.ResultQuery.ToString(), Update.Set("Name", "Name").ToString()); }