Skip to content

Commit d279245

Browse files
committed
CSHARP-4238: Convert unit tests for $dateXyz operators to integration tests.
1 parent 345aaae commit d279245

File tree

4 files changed

+293
-78
lines changed

4 files changed

+293
-78
lines changed

src/MongoDB.Bson/BsonUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static DateTime ToDateTimeFromMillisecondsSinceEpoch(long millisecondsSin
8383
millisecondsSinceEpoch > BsonConstants.DateTimeMaxValueMillisecondsSinceEpoch)
8484
{
8585
var message = string.Format(
86-
"The value {0} for the BsonDateTime MillisecondsSinceEpoch is outside the" +
86+
"The value {0} for the BsonDateTime MillisecondsSinceEpoch is outside the " +
8787
"range that can be converted to a .NET DateTime.",
8888
millisecondsSinceEpoch);
8989
throw new ArgumentOutOfRangeException("millisecondsSinceEpoch", message);

src/MongoDB.Driver/Linq/DateTimeExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public static long Subtract(this DateTime @this, DateTime startDate, DateTimeUni
235235
/// <param name="timezone">The timezone.</param>
236236
/// <returns>The resulting DateTime.</returns>
237237
/// <remarks>See the server documentation for $dateDiff for information on timezones in MongoDB.</remarks>
238-
public static DateTime Subtract(this DateTime @this, DateTime value, string timezone)
238+
public static TimeSpan Subtract(this DateTime @this, DateTime value, string timezone)
239239
{
240240
throw new InvalidOperationException("This DateTime.Subtract method is only intended to be used in LINQ queries.");
241241
}

src/MongoDB.Driver/Linq/Linq3Implementation/Translators/ExpressionToAggregationExpressionTranslators/MethodTranslators/DateTimeSubtractWithDateTimeMethodToAggregationExpressionTranslator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static AggregationExpression Translate(TranslationContext context, Method
9191
{
9292
startOfWeek = null;
9393
}
94-
serializer = BsonInt64Serializer.Instance;
94+
serializer = Int64Serializer.Instance;
9595
}
9696
else
9797
{

0 commit comments

Comments
 (0)