使用Nunit GUI运行单元测试

时间:2012-07-16 15:49:17

标签: nunit watin

我正在通过试验样本及其网站来学习watin和Nunit。

Getting Started with watin
使用VS2010,我在我的项目中创建一个类库,添加对watin和nunit框架的引用。然后我安装了Nunit GUI。我构建了我的类库。在文件菜单上打开GUi打开新项目并浏览到dll的位置班级图书馆。当我运行类(DLL)时,我收到错误:

Volotrust_watin.Class1.Start_google:
System.IO.FileNotFoundException:无法加载文件或程序集'Interop.SHDocVw,Version = 1.1.0.0,Culture = neutral,PublicKeyToken = db7cfd3acb5ad44e'或其依赖项之一。系统找不到指定的文件 这是我的代码:

使用System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using WatiN.Core;
using NUnit.Framework;


namespace Volotrust_watin
{    
[TestFixture]
[RequiresSTA]
public class Class1
{
[Test]
public void Start_google()
{
using (var browser = new IE("www.google.com"))
{
browser.TextField(Find.ByName("q")).TypeText("watin");
browser.Button(Find.ByName("btnG")).Click();
Assert.IsTrue(browser.ContainsText("watin"));

} 
}
}
} 

1 个答案:

答案 0 :(得分:0)

我终于通过从我的项目中删除Interop.SHDocVw.dll解决了我的问题。