public void 一二三集各買了一本_價格應為270() { //arrange var target = new Calculate(); var list = new List<Book>() { new Book { Type = type.第一集 }, new Book { Type = type.第二集 }, new Book { Type = type.第三集 } }; var expected = 270; //act var actual = target.Sum(list); //assert Assert.AreEqual(expected, actual); }
public void 第一集買了一本_其他都沒買_價格應為100元() { //arrange var target = new Calculate(); var list = new List<Book>() { new Book { Type = type.第一集 } }; var expected = 100; //act var actual = target.Sum(list); //assert Assert.AreEqual(expected, actual); }