All language subtitles for 015 Movie Store Store – Part 4 (Task 2 & 3)_en
Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,330 --> 00:00:03,030
For this solution, we're gonna cover tasks two and three.
2
00:00:11,860 --> 00:00:16,870
Going back to the third test case, we need to write a unit test that expects cell movie to throw an
3
00:00:16,870 --> 00:00:19,180
exception if a movie has already been rented.
4
00:00:22,310 --> 00:00:25,340
So here I can write a unit test that expects an illegal state exception.
5
00:00:26,360 --> 00:00:27,830
Test expected.
6
00:00:29,390 --> 00:00:31,970
And it expects an illegal state exception.
7
00:00:35,300 --> 00:00:36,200
DECLASSE.
8
00:00:43,520 --> 00:00:46,400
The unit test is called Movie Night in Stock.
9
00:00:49,120 --> 00:00:50,920
First, I'll rent The Godfather.
10
00:01:02,820 --> 00:01:04,800
And then I'll try to sell The Godfather.
11
00:01:09,630 --> 00:01:10,980
If I run the test now.
12
00:01:14,050 --> 00:01:18,820
It fails, it's expecting the test to throw in a legal state exception, but it isn't.
13
00:01:20,120 --> 00:01:24,710
And so now we need to make the test pass by throwing an illegal -- exception from sell movie.
14
00:01:35,750 --> 00:01:37,670
If the movie is already rented.
15
00:02:02,200 --> 00:02:03,940
Throw an illegal STD exception.
16
00:02:19,520 --> 00:02:21,830
Rerun the test and perfect.
17
00:02:24,170 --> 00:02:30,140
And just have a look at how clean and elegant the code is, when you write tests, before you write
18
00:02:30,140 --> 00:02:33,560
code, you're being forced to write code that is easy to test.
19
00:02:34,100 --> 00:02:38,030
At the same time, code that is easy to test won't get any bugs.
20
00:02:40,400 --> 00:02:42,800
And now what I'm going to do is run every single test.
21
00:02:46,760 --> 00:02:51,470
They all pass, which means the code inside Staudt Java doesn't have any bugs.
22
00:02:52,580 --> 00:02:57,380
And before we wrap up, just I want you to really appreciate how polished our code is.
23
00:03:01,850 --> 00:03:08,270
Compared the old code with the new code in the old code, the functions were massive, this function
24
00:03:08,270 --> 00:03:09,940
here is impossible to test.
25
00:03:10,340 --> 00:03:13,430
So if you get a bug here, it's going to be really hard to fix.
26
00:03:14,000 --> 00:03:21,290
In general, this is not good coding, but with unit testing, our code is a lot cleaner and immune
27
00:03:21,290 --> 00:03:22,070
to bugs.
2514
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.