test_names.py X TDD-ACIT2911 > names > test_names.py 1 from utils import names 2 3 def test_two_names(): 4 assert names.

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

test_names.py X TDD-ACIT2911 > names > test_names.py 1 from utils import names 2 3 def test_two_names(): 4 assert names.

Post by answerhappygod »

Test Names Py X Tdd Acit2911 Names Test Names Py 1 From Utils Import Names 2 3 Def Test Two Names 4 Assert Names 1
Test Names Py X Tdd Acit2911 Names Test Names Py 1 From Utils Import Names 2 3 Def Test Two Names 4 Assert Names 1 (60.33 KiB) Viewed 41 times
What is TDD? How would I write a TDD for the above code
snipping?
test_names.py X TDD-ACIT2911 > names > test_names.py 1 from utils import names 2 3 def test_two_names(): 4 assert names.split_name("Walter Anelko") ["Walter", "Anelko"] 5 6 def test_middle_names(): 7 assert names.split_name("Walter Pavel Anelko") == ["Walter Pavel", "Anelko"] 8 assert names.split_name("Walter Pavel Anelko Smith") ["Walter Pavel Anelko", "Smith"] == 9 10 11 def test_surname_prefixes(): assert names.split_name("Karina van der Nereus") == ["Karina", "van der Nereus"] assert names.split_name("Karina Alice van der Nereus") == ["Karina Alice", "van der Nereus"] 12 13 14 def test_split_name_onename(): assert names.split_name("Anelko") == ["", "Anelko"] 15 16 17 def test_split_name_nonames(): assert names.split_name("") 18 == ["",""]

TDD-ACIT2911 > names > main.py ... from utils import names 1 N name = input("Please enter your full name: ") first_name, last_name names.split_name (name) 3 4 5 6 7 8 9 NO OY print(f"Your first name is: {first_name}") print(f"Your last name is: {last_name}")
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply