def test_フルネームを取得できる(self): with self.subTest("和名"): self.assertEqual("Ken Tanaka", customer("Ken", "Tanaka", 15).full_name()) with self.subTest("英名"): self.assertEqual("Tom Ford", customer("Tom", "Ford", 53).full_name())
def test_顧客の入場料金がわかる(self): with self.subTest("20歳未満 1000円"): self.assertEqual(1000, customer("Ken", "Tanaka", 15).entry_fee()) with self.subTest("20歳以上65歳未満は 1500円"): self.assertEqual(1500, customer("Tom", "Ford", 53).entry_fee()) with self.subTest("65歳以上は 1200円"): self.assertEqual(1200, customer("Ieyasu", "Tokugawa", 73).entry_fee())
def test_顧客の情報をCSVで取得できる(self): customers = Customers() customers.add(customer("Ken", "Tanaka", 15)) customers.add(customer("Tom", "Ford", 53)) customers.add(customer("Ieyasu", "Tokugawa", 73)) expected = "Ken Tanaka,15,1000\n" \ "Tom Ford,53,1500\n" \ "Ieyasu Tokugawa,73,1200" self.assertEqual(expected, customers.info_csv())
def CustomerOpenFunc(self, event): self.design() upperButtons[2].grid_forget() upperButtons[3].grid_forget() upperButtons[4].bind( "<Leave>", lambda b: upperButtons[4].grid(in_=founationButtons[4])) if 'customer' in switching_func: switching_func.remove("customer") self.connectCustomer.destroy() else: pass switching_func.append("customer") if "add" in switching_func: switching_func.remove("add") self.connectDealer.destroy() elif "stock" in switching_func: switching_func.remove("stock") self.connectBilling.destroy() else: pass self.connectCustomer = customer(self.FrameRight) self.connectCustomer.pack(fill=BOTH, expand=YES) self.connectCustomer.customerPage()
def test_単一の顧客の情報をCSVで取得できる(self): Customer = customer("Ken", "Tanaka", 15) self.assertEqual("Ken Tanaka,15,1000", Customer.info_csv())
from Customer import customer from Kasa import kasa k = kasa() k.show_products_before() print("") k.prices() c = customer() c.order("Пица", "Голяма", 3, "Домат", "Пепси") c.order("Дюнер", "Голям", 2, "Зеле", "Айрян") c.order("Пица", "Средна", 4, "Не", "Пепси") c.pay(50) c.kasova_belejka() k.show_products_after() print("\n Сценарий 2:\n") c = customer() c.order("Дюнер", "Голям", 2, "Лук", "Пепси") c.order("Дюнер", "Малък", 1, "Не", "Айрян") c.order("Пица", "Средна", 3, "Салам", "Пепси") c.pay(20) c.kasova_belejka()