public void TestWithAPMCancel() { var storage = new SqlDataStorage(ConnectionString); string sql = "Select * from parameter"; storage.ReadToCollectionWithAPM(sql, new ParameterInfoCreator<string>(), null, new TestBackgroudCollection<ParameterInfo<string>>()); storage.Cancellation.Cancel(); }
public void TestExecuteSql() { var storage = new SqlDataStorage(ConnectionString); string guid = Guid.NewGuid().ToString(); string sql = string.Format("Insert into parameter(id) values('{0}')", guid); int result = storage.Execute(sql, exceptionHandle: new TestBackgroudData(1)); Assert.AreEqual(1, result); sql = string.Format("Delete from parameter where id = '{0}'", guid); result = storage.Execute(sql, exceptionHandle: new TestBackgroudData(1)); Assert.AreEqual(1, result); }
public DataTestBase() { var builder = new SqlConnectionStringBuilder { InitialCatalog = "UnitTest", DataSource = "116.54.125.122", UserID = "sa", Password = "******" }; Connection = builder.ConnectionString; Storage = new SqlDataStorage(Connection, TaskScheduler.Current); }