我正在尝试使用C#进行一些简单的测试驱动开发测试.但是我没有真正的经验,我遇到了一些麻烦.
我正在尝试执行的测试是用于登录身份验证.以下是我到目前为止的情况.
using System;
namespace TimetableSystem
{
public class Timetable
{
public bool TimetableLogin(string username, string password)
{
throw new NotImplementedException();
}
}
}
Run Code Online (Sandbox Code Playgroud)
测试方法
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TimetableSystem;
namespace TimetableSystemTests
{
[TestClass]
public void TestLoginMethodValid()
{
Timetable auth = new Timetable();
bool result = auth.TimetableLogin("Name", "Password");
Assert.IsTrue(result);
}
}
Run Code Online (Sandbox Code Playgroud)
这个测试一直在失败,我不确定为什么感谢任何帮助.