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()); }