• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 使用WatiN對ASP.NET頁面進行單元測試[3]

    發表于:2010-01-28來源:作者:點擊數: 標簽:單元AspWatiNNetNET
    使用WatiN對ASP.NET頁面進行單元測試[3] 單元測試工具 BaseTestPage類可以通過這些信息運行 服務器 ,所有繼承了它的測試類都可以使用這個功能了。 下面是BaseTestPage類的完整代碼: public class BaseTestPage { static Process server = null; static Bas

      使用WatiN對ASP.NET頁面進行單元測試[3]   單元測試工具 

         BaseTestPage類可以通過這些信息運行服務器,所有繼承了它的測試類都可以使用這個功能了。

      下面是BaseTestPage類的完整代碼:

      public class BaseTestPage

      {

      static Process server = null;

      static BaseTestPage()

      {

      if (Process.GetProcessesByName("WebDev.WebServer").Length == 0)

      {

      string webServerExePath = (string)ConfigurationManager.AppSettings["WebServerExePath"];

      server = new Process();

      Process.Start(webServerExePath, GetWebServerArguments());

      }

      }

      public static string GetWebServerArguments()

      {

      string args = String.Format("/port:{0} /path:\"{1}\"", GetPort(), GetWebApplicationPath());

      if (String.IsNullOrEmpty(args)) throw new ArgumentNullException("Arguments is not defined");

      return args;

      }

      public static string GetPort()

      {

      string port = ConfigurationManager.AppSettings["Port"] as String;

      if (String.IsNullOrEmpty(port)) throw new ArgumentNullException("Port is null or empty");

      return port;

      }

      public static string GetWebApplicationPath()

      {

      string webApplicationPath = ConfigurationManager.AppSettings["WebApplicationPath"] as String;

      if (String.IsNullOrEmpty(webApplicationPath)) throw new ArgumentNullException("WebApplicationPath is null or empty");

      return webApplicationPath;

      }

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>