public static QueryComplete Matches(string name, BsonRegularExpression regex) { if (name == null) { throw new ArgumentNullException("name"); } if (regex == null) { throw new ArgumentNullException("regex"); } return new QueryComplete(new BsonDocument(name, regex)); }
public void TestMatches() { var query = Query.Matches("a", "/abc/"); var expected = "{ 'a' : /abc/ }".Replace("'", "\""); Assert.AreEqual(expected, query.ToJson()); }