被测试类使用 [TestFixture]特性修饰,方法使用[Test]特性修饰,示例如下:
[TestFixture]
class Program
{
static void Main(string[] args)
{
}
[Test]
public void Query_TestUrl()
{
var response= "http://localhost:1234/user/333".GetAsync();
Assert.AreEqual(HttpStatusCode.OK, response.Result.StatusCode);
}
}
网友评论