Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2412

Fix SelectQuery tests on .NET Core2.1

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Testing
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      The tests below pass on .NET Framework 4.5.2 and .NET Core 1.0, but fail on .NET Core 2.1.

      [xUnit.net 00:00:20.09]     MongoDB.Driver.Tests.Linq.SelectQueryTests.TestWhereSTrimStartTrimEndToLowerInvariantContainsXyz [FAIL]
      Failed   MongoDB.Driver.Tests.Linq.SelectQueryTests.TestWhereSTrimStartTrimEndToLowerInvariantContainsXyz
      Error Message:
       System.InvalidOperationException : Sequence contains no elements
      Stack Trace:
         at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
         at MongoDB.Driver.Linq.PredicateTranslator.BuildStringQuery(MethodCallExpression methodCallExpression) in .\src\MongoDB.Driver.Legacy\Linq\Translators\PredicateTranslator.cs:line 1260
         at MongoDB.Driver.Linq.PredicateTranslator.BuildContainsQuery(MethodCallExpression methodCallExpression) in .\src\MongoDB.Driver.Legacy\Linq\Translators\PredicateTranslator.cs:line 543
         at MongoDB.Driver.Linq.PredicateTranslator.BuildMethodCallQuery(MethodCallExpression methodCallExpression) in .\src\MongoDB.Driver.Legacy\Linq\Translators\PredicateTranslator.cs:line 774
         at MongoDB.Driver.Linq.PredicateTranslator.BuildQuery(Expression expression) in .\src\MongoDB.Driver.Legacy\Linq\Translators\PredicateTranslator.cs:line 72
         at MongoDB.Driver.Linq.SelectQuery.BuildQuery() in .\src\MongoDB.Driver.Legacy\Linq\Translators\SelectQuery.cs:line 133
         at MongoDB.Driver.Tests.Linq.SelectQueryTests.TestWhereSTrimStartTrimEndToLowerInvariantContainsXyz() in .\tests\MongoDB.Driver.Legacy.Tests\Linq\SelectQueryTests.cs:line 6321
      
      [xUnit.net 00:00:20.20]     MongoDB.Driver.Tests.Linq.SelectQueryTests.TestWhereSTrimStartTrimEndToLowerContainsXyz [FAIL]
      Failed   MongoDB.Driver.Tests.Linq.SelectQueryTests.TestWhereSTrimStartTrimEndToLowerContainsXyz
      Error Message:
       System.InvalidOperationException : Sequence contains no elements
      Stack Trace:
         at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
         at MongoDB.Driver.Linq.PredicateTranslator.BuildStringQuery(MethodCallExpression methodCallExpression) in .\src\MongoDB.Driver.Legacy\Linq\Translators\PredicateTranslator.cs:line 1260
         at MongoDB.Driver.Linq.PredicateTranslator.BuildContainsQuery(MethodCallExpression methodCallExpression) in .\src\MongoDB.Driver.Legacy\Linq\Translators\PredicateTranslator.cs:line 543
         at MongoDB.Driver.Linq.PredicateTranslator.BuildMethodCallQuery(MethodCallExpression methodCallExpression) in .\src\MongoDB.Driver.Legacy\Linq\Translators\PredicateTranslator.cs:line 774
         at MongoDB.Driver.Linq.PredicateTranslator.BuildQuery(Expression expression) in .\src\MongoDB.Driver.Legacy\Linq\Translators\PredicateTranslator.cs:line 72
         at MongoDB.Driver.Linq.SelectQuery.BuildQuery() in .\src\MongoDB.Driver.Legacy\Linq\Translators\SelectQuery.cs:line 133
         at MongoDB.Driver.Tests.Linq.SelectQueryTests.TestWhereSTrimStartTrimEndToLowerContainsXyz() in .\tests\MongoDB.Driver.Legacy.Tests\Linq\SelectQueryTests.cs:line 6014
      
      [xUnit.net 00:00:03.76]     MongoDB.Driver.Tests.Linq.Translators.LegacyPredicateTranslatorTests.TestWhereSTrimStartTrimEndToLowerContainsXyz [FAIL]
      Failed   MongoDB.Driver.Tests.Linq.Translators.LegacyPredicateTranslatorTests.TestWhereSTrimStartTrimEndToLowerContainsXyz
      Error Message:
       System.InvalidOperationException : Sequence contains no elements
      Stack Trace:
         at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
         at MongoDB.Driver.Linq.Translators.PredicateTranslator.TranslateStringQuery(MethodCallExpression methodCallExpression) in .\src\MongoDB.Driver\Linq\Translators\PredicateTranslator.cs:line 1420
         at MongoDB.Driver.Linq.Translators.PredicateTranslator.TranslateContains(MethodCallExpression methodCallExpression) in .\src\MongoDB.Driver\Linq\Translators\PredicateTranslator.cs:line 572
         at MongoDB.Driver.Linq.Translators.PredicateTranslator.TranslateMethodCall(MethodCallExpression methodCallExpression) in .\src\MongoDB.Driver\Linq\Translators\PredicateTranslator.cs:line 758
         at MongoDB.Driver.Linq.Translators.PredicateTranslator.Translate(Expression node) in .\src\MongoDB.Driver\Linq\Translators\PredicateTranslator.cs:line 90
         at MongoDB.Driver.Linq.Translators.PredicateTranslator.Translate(Expression node, IBsonSerializerRegistry serializerRegistry) in .\src\MongoDB.Driver\Linq\Translators\PredicateTranslator.cs:line 59
         at MongoDB.Driver.Linq.Translators.PredicateTranslator.Translate[TDocument](Expression`1 predicate, IBsonSerializer`1 parameterSerializer, IBsonSerializerRegistry serializerRegistry) in .\src\MongoDB.Driver\Linq\Translators\PredicateTranslator.cs:line 52
         at MongoDB.Driver.Tests.Linq.Translators.LegacyPredicateTranslatorTests.Assert[TDocument](Expression`1 filter, Int32 expectedCount, String expectedFilter) in .\tests\MongoDB.Driver.Tests\Linq\Translators\LegacyPredicateTranslatorTests.cs:line 1178
         at MongoDB.Driver.Tests.Linq.Translators.LegacyPredicateTranslatorTests.TestWhereSTrimStartTrimEndToLowerContainsXyz() in .\tests\MongoDB.Driver.Tests\Linq\Translators\LegacyPredicateTranslatorTests.cs:line 883
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            vincent.kam@mongodb.com Vincent Kam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: