數字,我花了一個小時搜索之前發佈的問題,然後我找到答案10分鐘後。下面是我測試的代碼,其中包含commandtimeout的代碼行:
[TestMethod()]
public void CreateScenario_FromProject_Q123314_FromVersion_AA()
{
SqlDatabaseTestActions testActions = this.SqlTest1Data;
// Execute the pre-test script
//
System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "Executing pre-test script...");
SqlExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction);
// Execute the test script
//
System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "Executing test script...");
this.ExecutionContext.CommandTimeout = 180; // HERE IS THE COMMANDTIMEOUT
SqlExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction);
// Execute the post-test script
//
System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "Executing post-test script...");
SqlExecutionResult[] posttestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction);
}
將此標記爲您的答案,可能有助於將來某個人的出行。 – Andrew
我會的。但是我必須等待2天的限制纔可以。 – DeadZone