mirror of
https://github.com/DapperLib/Dapper.git
synced 2026-10-18 22:31:08 +08:00
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using System;
|
|
using System.Reflection;
|
|
using System.Data.SqlClient;
|
|
|
|
namespace DapperTests_NET35
|
|
{
|
|
class Program
|
|
{
|
|
static void Main()
|
|
{
|
|
RunTests();
|
|
Console.WriteLine("(end of tests; press any key)");
|
|
|
|
Console.ReadKey();
|
|
}
|
|
public static readonly string connectionString = "Data Source=.;Initial Catalog=tempdb;Integrated Security=True";
|
|
|
|
public static SqlConnection GetOpenConnection()
|
|
{
|
|
var connection = new SqlConnection(connectionString);
|
|
connection.Open();
|
|
return connection;
|
|
}
|
|
private static void RunTests()
|
|
{
|
|
var tester = new Tests();
|
|
foreach (var method in typeof(Tests).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
|
|
{
|
|
Console.Write("Running " + method.Name);
|
|
method.Invoke(tester, null);
|
|
Console.WriteLine(" - OK!");
|
|
}
|
|
}
|
|
}
|
|
}
|