public void ModifyDataTest() { _dataManage.ModifyData("drink", -1, "名稱", "asd"); _dataManage.ModifyData("drink", 0, "名稱", "asd"); _dataManage.ModifyData("addition", -1, "名稱", "asd"); _dataManage.ModifyData("addition", 0, "名稱", "asd"); _dataManage.AddData("dad", 1341, "drink"); _dataManage.AddData("sad", 1341, "addition"); Assert.AreNotEqual(_dataManage.ExistItem("dad"), null); _dataManage.ModifyData("drink", 0, "名稱", "asd"); Assert.AreNotEqual(_dataManage.ExistItem("asd"), null); Assert.AreEqual(_dataManage.ExistItem("dad"), null); _dataManage.ModifyData("drink", 0, "價錢", "asd"); Assert.AreEqual(_dataManage.ExistItem("asd").Price, 0); _dataManage.ModifyData("drink", 0, "價錢", "213"); Assert.AreEqual(_dataManage.ExistItem("asd").Price, 213); Assert.AreNotEqual(_dataManage.ExistItem("sad"), null); _dataManage.ModifyData("addition", 0, "名稱", "aaa"); Assert.AreNotEqual(_dataManage.ExistItem("aaa"), null); Assert.AreEqual(_dataManage.ExistItem("sad"), null); _dataManage.ModifyData("addition", 0, "價錢", "asd"); Assert.AreEqual(_dataManage.ExistItem("aaa").Price, 0); _dataManage.ModifyData("addition", 0, "價錢", "213"); Assert.AreEqual(_dataManage.ExistItem("aaa").Price, 213); }