本文整理汇总了C#中Person.addWallet方法的典型用法代码示例。如果您正苦于以下问题:C# Person.addWallet方法的具体用法?C# Person.addWallet怎么用?C# Person.addWallet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person.addWallet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestCase2
public void TestCase2()
{
// test case 2 data setup
// wallet 1 credit cards
List<string> creditCardList1 = new List<string>();
creditCardList1.Add("Visa");
creditCardList1.Add("Discover");
// wallet 2 credit cards
List<string> creditCardList2 = new List<string>();
creditCardList2.Add("MasterCard");
Person personB = new Person();
Wallet wallet1 = new Wallet(creditCardList1);
personB.addWallet(wallet1);
Assert.AreEqual(11, wallet1.getTotalInterest());
Wallet wallet2 = new Wallet(creditCardList2);
personB.addWallet(wallet2);
Assert.AreEqual(5, wallet2.getTotalInterest());
Assert.AreEqual(16, personB.getTotalInterestPerPerson());
}
示例2: TestCase3
public void TestCase3()
{
// test case 3 data setup
// wallet 3 credit cards
List<string> creditCardList3 = new List<string>();
creditCardList3.Add("MasterCard");
creditCardList3.Add("Visa");
// wallet 4 credit cards
List<string> creditCardList4 = new List<string>();
creditCardList4.Add("Visa");
creditCardList4.Add("MasterCard");
Person personC = new Person();
Wallet wallet3 = new Wallet(creditCardList3);
personC.addWallet(wallet3);
Assert.AreEqual(15, personC.getTotalInterestPerPerson());
Person personD = new Person();
Wallet wallet4 = new Wallet(creditCardList4);
personD.addWallet(wallet4);
Assert.AreEqual(15, personD.getTotalInterestPerPerson());
}
示例3: TestCase1
public void TestCase1()
{
// test case 1 data setup
// wallet credit cards
List<string> creditCardList = new List<string>();
creditCardList.Add("Visa");
creditCardList.Add("MasterCard");
creditCardList.Add("Discover");
// test case 1 person
Person personA = new Person();
Wallet walletA = new Wallet(creditCardList);
personA.addWallet(walletA);
Assert.AreEqual(16, personA.getTotalInterestPerPerson());
}