All language subtitles for 022 Shopping Cart – Part 5_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian Download
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Now we're going to take care of the exceptions we need to write a unit test and expect to remove to

throw an exception if there's nothing in there.

So here I can write a unit test that expect an illegal state exception, test expected.

Is equal to a legal state exception, not class.

The unit test is called Invalid Remove State.

And first, I'm going to remove both items from the array list.

And I'm going to try to call a remove a third time.

If I run the test now, it fails, it's expecting the test to throw in a legal state exception, but

it isn't.

So now we're going to make the test pass by throwing an illegal STD exception from remove, if the card

is empty, then throw an illegal state exception.

And pass on a message.

We were on the test.

And perfect.

Can this could be made simpler, not the code, but we can make the unit test more concise.

I don't like how the cart class doesn't have a method we can just use to clear the shopping cart calling

remove so many times is kind of awkward.

Someone should avoid method name to clear that clears the area list.

This item is the clear, and that is all.

Now, back in the unit test, we can just clear the shopping cart.

And everything still works as it should.

All right, the final test we got to write is one that expects Check-Out to throw an exception if there's

nothing in there.

So here I can read another unit test that expects an illegal STD exception.

The unit test is called invalid check out state.

First, I'll clear the shopping cart.

Then I'll try to call check out.

If I run the test now, it fails, it's expecting the test to throw an legal state exception, but it

isn't.

So we got to make the test pass by throwing an illegal fit exception from check out if the card is empty.

Then throw in a legal state exception.

Pass a message.

Run the test and perfect.

Now, what I'm going to do is run every single test.

They all passed, which means the code in Kadirgamar doesn't have any books.

And just have a look at how clean and elegant the code is, when you write tests, before you write

code, you're being forced to write code that is easy to test.

And such code tends to be more polished.

Each method performs one task.

Each method is modular, is immune to bugs and easy to understand.

This is why I love test driven development writing tests before writing code.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.