我正在尝试在Sharpdevelop中建立测试框架(Visual Studio的开源和超轻量级),但是在本指南中,创建者正在使用Visual Studio。
他首先创建一个名为WordpressAutomation的新项目和一个包含以下代码的类库:
然后,他使用解决方案中的单元测试项目模板创建另一个项目,并调用WordpressTests。它包含以下代码。
他基本上在他的wordpresstest项目中引用了wordpressautomation代码……它打开了Firefox。简单。
现在Sharpdevelop没有"unit test"项目模板,所以我改为创建一个空项目,然后创建一个单元测试类,然后从那里去。
然而 , when trying to 跑 it gives me the "CS5001-不包含适用于入口点的静态“ 主要”方法" error.
我怎样才能解决这个问题?
谢谢!
他首先创建一个名为WordpressAutomation的新项目和一个包含以下代码的类库:
C#:
Using system;
using system.collections.generic;
using system.linq;
using system.text;
using system.threading.tasks;
using openqa.selenium.firefox; // used to control browser
namespace WordpressAutomation
{
public class Class1
{
public void Go()
{
var driver = new FirefoxDriver();
driver.Navigate().GoToUrl("http://www.google.com");
}
}
}
C#:
using system;
using microsoft.visualstudio.testtools.unittesting;
[I]using wordpressautomation;[/I]
namespace WordpressTests
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod()
{
var c = new Class1();
c.Go();
}
}
}
他基本上在他的wordpresstest项目中引用了wordpressautomation代码……它打开了Firefox。简单。
现在Sharpdevelop没有"unit test"项目模板,所以我改为创建一个空项目,然后创建一个单元测试类,然后从那里去。
然而 , when trying to 跑 it gives me the "CS5001-不包含适用于入口点的静态“ 主要”方法" error.
我怎样才能解决这个问题?
谢谢!