public static void TestFixtureSetup(TestContext context) { con = new NpgsqlConnection(cs); con.Open(); keySequenceService = new KeySequenceService(con); keySequenceRepository = new KeySequenceRepository(con); DeleteTestRecord(); }
/// <summary> /// Initializes a new instance of the <see cref="BackEndService{T, U, V, W}"/> class. /// </summary> /// <param name="npgsqlConnection">The NPGSQL connection.</param> /// <exception cref="ArgumentNullException">npgsqlConnection</exception> protected BackEndService(NpgsqlConnection npgsqlConnection) { this.npgsqlConnection = npgsqlConnection ?? throw new ArgumentNullException(nameof(npgsqlConnection)); keySequenceService = new KeySequenceService(npgsqlConnection); repository = (U)Activator.CreateInstance(typeof(U), npgsqlConnection); validation = (V)Activator.CreateInstance(typeof(V), npgsqlConnection); }