Afrikaans
Akan
Albanian
Amharic
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
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
In this video we are going to add some more tests for the remaining metals in this class.
And the next method that we want to focus on is the day of the week.
So for this method we are going to create a new group called Day of Week with G.B. locale.
And then we can create a group body and then we are going to copy paste the setup matlab and the first
test from the previous group and then we are going to adjust the first name to be Monday and we're going
to make sure that we call format that day of week and that the expectation is the first three letters
of Monday because this is a short format of the day of the week.
And then we can run the tests once again and as we can see we get a success.
OK.
So now that we have this we could duplicate this group and test for example the same method but with
a different locale.
So here I could put a day a week but this time with the Italian locale and here I could change the default
locale to I.T. on the score 90 and then I could change that description to unity which is the Italian
for Monday and I can change the expectation to l you.
And we would be what we expect.
So I can run the tests one more time and as we can see the tests pass for the Italian locale as well.
Moving on we could add some tests for the currency method so we could add a new group called currency.
And this time for example with U S local and then I could add the group body and in here I can now set
setup method and inside here I could said i n the l don't default to look out to and on the score U
S like this.
And because in this case we are not doing date for month and thus then I don't need to initialize date
formatting so I can go straight on to writing the test.
And just to make my life a bit quicker I'm going to copy these three tests from the hours group and
I went to paste them into here and then I can update the expectations to ensure that we go form up the
currency and here rather than 10 hours what we want to print is dollar number 10.
Like this.
And the second test will expect format the currency of zero to be an empty string.
Because this is how this method is implemented.
And finally we can implement the last test with minus five.
And in this case we expect to see minus and then $ 5 like this.
OK.
So we have learned about testing code that does no date and currency formatting and adding more tests
at this point would become repetitive because it is just about setting up a locale and writing the correct
expectations.
So at this stage I can run all the tests for this file and I can see that they are all green.
So we can continue on the next video.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.