Skip to content

Commit 9ae190e

Browse files
committed
wrap the not supported test itself in if / endif
1 parent c734f8a commit 9ae190e

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

tests/MongoDB.Driver.Tests/Linq/Integration/StringTrimTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void Select_with_TrimEnd_with_empty_chars_should_work()
133133
results.Should().Equal(" abcd", "abcd", " abcd", "abcd");
134134
}
135135

136-
// TODO CSHARP-5979: Add coverage for parameterless and single char overloads of Trim, TrimStart, and TrimEnd.
136+
// Add coverage for parameterless and single char overloads of Trim, TrimStart, and TrimEnd, see https://jira.mongodb.org/browse/CSHARP-5979
137137
// e.g. Trim(' '), TrimStart(), TrimStart(' '), TrimEnd(), TrimEnd(' ')
138138

139139
public class C

tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/SerializerFinders/StringTests.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public void SerializerFinder_should_resolve_string_methods(LambdaExpression expr
3939
serializerMap.GetSerializer(expression.Body).Should().BeOfType(expectedSerializerType);
4040
}
4141

42+
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
4243
[Theory]
4344
[MemberData(nameof(NotSupportedTestCases))]
4445
public void SerializerFinder_should_throw_for_unsupported_string_methods(LambdaExpression expression, Type expectedSerializerType)
@@ -52,6 +53,7 @@ public void SerializerFinder_should_throw_for_unsupported_string_methods(LambdaE
5253
var exception = Record.Exception(() => serializerMap.GetSerializer(expression.Body));
5354
exception.Should().BeOfType<ExpressionNotSupportedException>();
5455
}
56+
#endif
5557

5658
public static readonly object[][] SupportedTestCases =
5759
[
@@ -133,18 +135,17 @@ public void SerializerFinder_should_throw_for_unsupported_string_methods(LambdaE
133135
[TestHelpers.MakeLambda((MyModel model) => model.Name.TrimEnd(new char[] { ' ' })), typeof(StringSerializer)],
134136
];
135137

138+
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
136139
public static readonly object[][] NotSupportedTestCases =
137140
[
138-
// TODO CSHARP-5979 Make these tests supported once we support parameterless and single char overloads of Trim, TrimStart and TrimEnd.
139-
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
140-
141+
// Not supported yet, see https://jira.mongodb.org/browse/CSHARP-5979
141142
[TestHelpers.MakeLambda((MyModel model) => model.Name.Trim(' ')), typeof(StringSerializer)],
142143
[TestHelpers.MakeLambda((MyModel model) => model.Name.TrimStart(' ')), typeof(StringSerializer)],
143144
[TestHelpers.MakeLambda((MyModel model) => model.Name.TrimEnd()), typeof(StringSerializer)],
144145
[TestHelpers.MakeLambda((MyModel model) => model.Name.TrimStart()), typeof(StringSerializer)],
145146
[TestHelpers.MakeLambda((MyModel model) => model.Name.TrimEnd()), typeof(StringSerializer)],
146-
#endif
147147
];
148+
#endif
148149

149150
private class MyModel
150151
{

0 commit comments

Comments
 (0)