I noticed that some test cases were failing against MongoDB.Driver 1.1, so I fixed them.
6275d176 fixes MongoQueryProviderTests.Regex_IsMatch(), .Regex_IsMatch_CaseInsensitive(), .String_EndsWith(), and .String_StartsWith().
These were failing because the MongoDB driver has changed its JSON serialization for regular expressions. I’ve fixed this by changing the tests so that, instead of doing a string comparison against a JSON serialization of the query BsonDocument, they do a direct structural comparison against the query BsonDocument itself, since that is what we really care about.
In 787887e9, I have pre-emptively made equivalent changes to all the other tests in the MongoQueryProviderTests fixture. The meanings of the tests are not changed, but they now all do structural comparisons against BsonDocuments instead of string comparisons. This should ensure that the tests don’t break in future due to some trivial (and irrelevant) change to the MongoDB driver’s JSON serialization.
In ef4e6c07 and e8502863, I have restored a test case that was commented-out, and changed it to do structural comparison instead of string comparison. I’m not sure why this test was commented-out; it seems like a sensible test and it passes without issue.
In 86682910, I have removed a redundant using statement.
Hi,
I noticed that some test cases were failing against MongoDB.Driver 1.1, so I fixed them.
MongoQueryProviderTests.Regex_IsMatch()
,.Regex_IsMatch_CaseInsensitive()
,.String_EndsWith()
, and.String_StartsWith()
.These were failing because the MongoDB driver has changed its JSON serialization for regular expressions. I’ve fixed this by changing the tests so that, instead of doing a string comparison against a JSON serialization of the query
BsonDocument
, they do a direct structural comparison against the queryBsonDocument
itself, since that is what we really care about.MongoQueryProviderTests
fixture. The meanings of the tests are not changed, but they now all do structural comparisons againstBsonDocument
s instead of string comparisons. This should ensure that the tests don’t break in future due to some trivial (and irrelevant) change to the MongoDB driver’s JSON serialization.using
statement.Cheers, Dan.