コード例 #1
0
ファイル: main_test.py プロジェクト: nkolew/Softuni-Python
 def test_gym_add_customer(self):
     Gym.id = 1
     g = Gym()
     c = Customer("Pesho", "addr.", "*****@*****.**")
     g.add_customer(c)
     g.add_customer(c)
     self.assertEqual(g.customers, [c])
コード例 #2
0
ファイル: main_test.py プロジェクト: nkolew/Softuni-Python
 def test_gym_init(self):
     g = Gym()
     self.assertEqual(g.customers, [])
     self.assertEqual(g.trainers, [])
     self.assertEqual(g.equipment, [])
     self.assertEqual(g.plans, [])
     self.assertEqual(g.subscriptions, [])
コード例 #3
0
ファイル: main_test.py プロジェクト: nkolew/Softuni-Python
 def test_gym_subscription_info(self):
     Gym.id = 1
     Subscription.id = 1
     ExercisePlan.id = 1
     Equipment.id = 1
     Trainer.id = 1
     Customer.id = 1
     g = Gym()
     s = Subscription("10.02.2020", 1, 1, 1)
     p = ExercisePlan(1, 1, 10)
     e = Equipment("Pesho")
     t = Trainer("Pesho")
     c = Customer("Pesho", "addr.", "*****@*****.**")
     g.add_subscription(s)
     g.add_customer(c)
     g.add_equipment(e)
     g.add_plan(p)
     g.add_trainer(t)
     self.assertEqual(g.subscription_info(1),
         "Subscription <1> on 10.02.2020\nCustomer <1> Pesho; Address: addr.; Email: [email protected]\nTrainer <1> Pesho\nEquipment <1> Pesho\nPlan <1> with duration 10 minutes")
コード例 #4
0
ファイル: main_test.py プロジェクト: nkolew/Softuni-Python
 def test_gym_add_equipment(self):
     g = Gym()
     e = Equipment("Pesho")
     g.add_equipment(e)
     g.add_equipment(e)
     self.assertEqual(g.equipment, [e])
コード例 #5
0
ファイル: main_test.py プロジェクト: nkolew/Softuni-Python
 def test_gym_add_trainer(self):
     g = Gym()
     t = Trainer("Pesho")
     g.add_trainer(t)
     g.add_trainer(t)
     self.assertEqual(g.trainers, [t])
コード例 #6
0
ファイル: main_test.py プロジェクト: nkolew/Softuni-Python
 def test_gym_add_subscription(self):
     g = Gym()
     s = Subscription("10.02.2020", 1, 1, 1)
     g.add_subscription(s)
     g.add_subscription(s)
     self.assertEqual(g.subscriptions, [s])
コード例 #7
0
ファイル: main_test.py プロジェクト: nkolew/Softuni-Python
 def test_gym_add_plan(self):
     g = Gym()
     p = ExercisePlan(1, 1, 10)
     g.add_plan(p)
     g.add_plan(p)
     self.assertEqual(g.plans, [p])
コード例 #8
0
from project.customer import Customer
from project.equipment import Equipment
from project.exercise_plan import ExercisePlan
from project.gym import Gym
from project.subscription import Subscription
from project.trainer import Trainer

customer = Customer("John", "Maple Street", "*****@*****.**")
equipment = Equipment("Treadmill")
trainer = Trainer("Peter")
subscription = Subscription("14.05.2020", 1, 1, 1)
plan = ExercisePlan(1, 1, 20)

gym = Gym()

gym.add_customer(customer)
gym.add_equipment(equipment)
gym.add_trainer(trainer)
gym.add_plan(plan)
gym.add_subscription(subscription)

print(Customer.get_next_id())

print(gym.subscription_info(1))

# c = Customer("Sofia", "Lozen", "*****@*****.**")
# print(c)
#
# m = Customer("Sofia", "Lozen", "*****@*****.**")
# print(c)
# print(m)