[CSHARP-2411] Fix TestReplace on .NET Core 2.1 Created: 04/Oct/18  Updated: 31/Mar/22

Status: Backlog
Project: C# Driver
Component/s: Testing
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Vincent Kam (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CSHARP-2174 Use a single solution and set of proj... Closed
is related to CSHARP-2402 Increase .NET testing coverage Closed

 Description   

The TestReplace tests in the Legacy driver fail on .NET Core 2.1 because the key-value-pairs are out of order.

[xUnit.net 00:00:01.66]     MongoDB.Driver.Tests.Builders.UpdateBuilderTests.TestReplace_Typed [FAIL]
Failed   MongoDB.Driver.Tests.Builders.UpdateBuilderTests.TestReplace_Typed
Error Message:
 Assert.Equal() Failure
             ↓ (pos 3)
Expected: { "_id" : 1, "x" : 2, "xl" : NumberLong(0), ···
Actual:   { "x" : 2, "_id" : 1, "xl" : NumberLong(0), ···
             ↑ (pos 3)
Stack Trace:
   at MongoDB.Driver.Tests.Builders.UpdateBuilderTests.TestReplace_Typed() in .\tests\MongoDB.Driver.Legacy.Tests\Builders\UpdateBuilderTests.cs:line 856
[xUnit.net 00:00:01.67]     MongoDB.Driver.Tests.Builders.UpdateBuilderTests.TestReplace [FAIL]
Failed   MongoDB.Driver.Tests.Builders.UpdateBuilderTests.TestReplace
Error Message:
 Assert.Equal() Failure
             ↓ (pos 3)
Expected: { "_id" : 1, "x" : 2, "xl" : NumberLong(0), ···
Actual:   { "x" : 2, "_id" : 1, "xl" : NumberLong(0), ···
             ↑ (pos 3)
Stack Trace:
   at MongoDB.Driver.Tests.Builders.UpdateBuilderTests.TestReplace() in .\tests\MongoDB.Driver.Legacy.Tests\Builders\UpdateBuilderTests.cs:line 847



 Comments   
Comment by Vincent Kam (Inactive) [ 23/Jan/20 ]

This issue came up again in the context of this PR: https://github.com/DmitryLukyanov/mongo-csharp-driver/pull/101/files

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