[CSHARP-4238] Convert unit tests for $dateXyz operators to integration tests Created: 29/Jun/22  Updated: 28/Oct/23  Resolved: 30/Jun/22

Status: Closed
Project: C# Driver
Component/s: LINQ3
Affects Version/s: 2.16.1
Fix Version/s: 2.17.0

Type: Improvement Priority: Unknown
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CSHARP-3343 Expressions for datetime durations Closed
Backwards Compatibility: Fully Compatible

 Description   

There is at least one bug in the work done for CSHARP-3343 to support $dateXyz operators. The following method should return TimeSpan not DateTime:

https://github.com/mongodb/mongo-csharp-driver/blob/v2.16.1/src/MongoDB.Driver/Linq/DateTimeExtensions.cs#L238

The existing unit test does not fail because we are only asserting on the generated MQL which is correct. A full round trip integration test probably would have revealed the issue.

Let's convert all unit tests for CSHARP-3343 to integration tests.



 Comments   
Comment by Githook User [ 01/Jul/22 ]

Author:

{'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}

Message: CSHARP-4238: Skip new integration tests on older servers.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/ea672977912f3a35bf0998ba2fef7bf887e256fa

Comment by Githook User [ 30/Jun/22 ]

Author:

{'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}

Message: CSHARP-4238: Convert unit tests for $dateXyz operators to integration tests.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/d279245bfb4b0ffb5e6e684c6a082bcec511290b

Generated at Wed Feb 07 21:47:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.