Skip to content

Commit c755b89

Browse files
committed
Moved common test helpers to a TestHelpers class.
1 parent ff6d68d commit c755b89

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

SqlServerSimulator.Tests/BuiltInFunctionTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
using System.Data.Common;
22
using static Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
3+
using static SqlServerSimulator.TestHelpers;
34

45
namespace SqlServerSimulator;
56

67
[TestClass]
78
public sealed class BuiltInFunctionTests
89
{
9-
private static object? ExecuteScalar(string commandText) => new Simulation().ExecuteScalar(commandText);
10-
11-
private static T ExecuteScalar<T>(string commandText) where T : struct => new Simulation().ExecuteScalar<T>(commandText);
1210

1311
[TestMethod]
1412
public void UnrecognizedBuiltInFunction()

SqlServerSimulator.Tests/SelectTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
using System.Data.Common;
2+
using static SqlServerSimulator.TestHelpers;
23

34
namespace SqlServerSimulator;
45

56
[TestClass]
67
public class SelectTests
78
{
8-
private static object? ExecuteScalar(string commandText) => new Simulation().ExecuteScalar(commandText);
9-
109
private static DbDataReader ExecuteReaderAndRead(string commandText)
1110
{
1211
var reader = new Simulation().ExecuteReader(commandText);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace SqlServerSimulator;
2+
3+
internal static class TestHelpers
4+
{
5+
public static object? ExecuteScalar(string commandText) => new Simulation().ExecuteScalar(commandText);
6+
7+
public static T ExecuteScalar<T>(string commandText) where T : struct => new Simulation().ExecuteScalar<T>(commandText);
8+
}

0 commit comments

Comments
 (0)