生成的测试代码如下,为了紧凑的表现代码,将注释代码作了删除。
using BankAccountDemo.Business;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace BankAccountDemo.Business.Tests
{
[TestClass()]
public class BankAccountTest
{
private TestContext testContextInstance;
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
#endregion
[TestMethod()]
public void CurrentBalanceTest()
{
float initialBalance = 0F; // TODO: Initialize to an appropriate value
BankAccount target = new BankAccount(initialBalance); // TODO: Initialize to an appropriate value
float expected = 0F; // TODO: Initialize to an appropriate value
float actual;
target.CurrentBalance = expected;
actual = target.CurrentBalance;
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
[TestMethod()]
public void makePaymentTest()
{
float initialBalance = 0F; // TODO: Initialize to an appropriate value
BankAccount target = new BankAccount(initialBalance); // TODO: Initialize to an appropriate value
float paymentAmount = 0F; // TODO: Initialize to an appropriate value
target.makePayment(paymentAmount);
Assert.Inconclusive("A method that does not return a value cannot be verified.");
}
[TestMethod()]
public void depositMoneyTest()
{
float initialBalance = 0F; // TODO: Initialize to an appropriate value
BankAccount target = new BankAccount(initialBalance); // TODO: Initialize to an appropriate value
float depositAmount = 0F; // TODO: Initialize to an appropriate value
target.depositMoney(depositAmount);
Assert.Inconclusive("A method that does not return a value cannot be verified.");
}