public void 投入金額と投入金額総計が一致するかテスト(int insertNum,int exp1,int exp2 ,int exp3,int exp4) { //投入するお金を用意 this.SetMoneyNum(insertNum); var target = new MoneyController(); //10円*1を投入 target.InputMoneyAdd(this.yen10); var expect = exp1; var actual = target.InputMoneySum(); Assert.AreEqual(expect, actual); //50円を投入 target.InputMoneyAdd(this.yen50); expect = exp2; actual = target.InputMoneySum(); Assert.AreEqual(expect, actual); //100円を投入 target.InputMoneyAdd(this.yen100); expect = exp3; actual = target.InputMoneySum(); Assert.AreEqual(expect, actual); //500円を投入 target.InputMoneyAdd(this.yen500); expect = exp4; actual = target.InputMoneySum(); Assert.AreEqual(expect, actual); }
public void 投入金額と投入金額総計が一致するかテスト(int insertNum, int expect) { //投入するお金を用意 this.SetMoneyNum(insertNum); var target = new MoneyController(); //1円を投入 target.InputMoneyAdd(this.yen1); //5円を投入 target.InputMoneyAdd(this.yen5); //10円を投入 target.InputMoneyAdd(this.yen10); //50円を投入 target.InputMoneyAdd(this.yen50); //100円を投入 target.InputMoneyAdd(this.yen100); //500円を投入 target.InputMoneyAdd(this.yen500); //1000円を投入 target.InputMoneyAdd(this.yen1000); //2000円を投入 target.InputMoneyAdd(this.yen2000); //5000円を投入 target.InputMoneyAdd(this.yen5000); //10000円を投入 target.InputMoneyAdd(this.yen10000); //投入金額合計 var actual = target.InputMoneySum(); Assert.AreEqual(expect, actual); }