Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Regression test for adding enum value and integer
  • Loading branch information
glopesdev committed Nov 29, 2025
commit 0fef27a9b66cbe4532704503e55418ae43eafcef
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.8.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.8.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async Task AssertExpressionTransform<TSource, TResult>(string expression, TSourc
Assert.AreEqual(expected, result);
}

[DataTestMethod]
[TestMethod]
[DataRow("it", 42, 42)]
[DataRow("it * 2", 21, 42)]
[DataRow("Single(it)", 42, 42f)]
Expand All @@ -38,6 +38,7 @@ async Task AssertExpressionTransform<TSource, TResult>(string expression, TSourc
[DataRow("new[] { it }", 42, new[] { 42 })]
[DataRow("new[] { it }.Select(x => x * 2).ToArray()", 21, new[] { 42 })]
[DataRow("np(string(null).Length) ?? it", 42, 42)]
[DataRow("DayOfWeek(it + 1)", DayOfWeek.Monday, DayOfWeek.Tuesday)]
public Task TestExpressionTransform<TSource, TResult>(string expression, TSource value, TResult expected)
{
return AssertExpressionTransform(expression, value, expected);
Expand All @@ -52,7 +53,7 @@ public Task TestExpressionTransform<TSource, TResult>(string expression, TSource
[TestMethod]
public Task TestObjectExpression() => AssertExpressionTransform("object(it)", 42, (object)42);

[DataTestMethod]
[TestMethod]
[DataRow("single(it)", 42, 42f)]
[DataRow("int64?(it).hasvalue", 42, true)]
[DataRow("math.pi", 42, Math.PI)]
Expand All @@ -69,7 +70,7 @@ public Task TestCasingCompatibility<TSource, TResult>(string expression, TSource
return AssertExpressionTransform(expression, value, expected);
}

[DataTestMethod]
[TestMethod]
[DataRow("")]
[DataRow("string(it)")]
public Task TestInvalidExpression(string expression)
Expand Down