123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- import org.junit.Test;
- import org.junit.Assert;
-
- public class CurrencyConverterTest {
-
- @Test
- public void ConvertDollarToEuro(){
- //when
- double dolla = 10;
-
-
- //expected
- double expected = 9.40;
-
-
-
- //actual
- double actual = CurrencyConverter.ConvertDollarToEuro(dolla);
-
- Assert.assertEquals(expected, actual, 0);
-
- }
-
- @Test
- public void EuroToDollar(){
- double euro = 0.94;
-
- double expected = 0.94;
-
- double actual = CurrencyConverter.EuroToDollar(euro);
-
- Assert.assertEquals(expected, actual, 0);
-
-
- }
-
- @Test
- public void EuroToBritishPound(){
- //when
- double euro = 50;
- //expected
- double expected = 41;
- //actual
- double actual = CurrencyConverter.EuroToBritishPound(euro);
-
- Assert.assertEquals(expected, actual, 0);
- }
-
- @Test
- public void BritishPoundToRupee(){
- double britishPound = 100;
-
- double expected = 6832;
-
- double actual = CurrencyConverter.BritishPoundToRupee(britishPound);
-
- Assert.assertEquals(expected, actual, 0);
- }
-
- @Test
- public void RuppeeToCanadianDolla(){
- double ruppee = 20;
-
- double expected = 26.4;
-
- double actual = CurrencyConverter.RupeeToCanadianDollar(ruppee);
-
- Assert.assertEquals(expected, actual, 0);
- }
-
- @Test
- public void CanadianDollarToSingapore(){
- double canadianDollar = 30;
-
- double expected = 42.9;
-
- double actual = CurrencyConverter.canadianToSingapore(canadianDollar);
-
- Assert.assertEquals(expected, actual, 0);
- }
-
- @Test
- public void SingaporeToSwiss(){
- double singapore = 30;
-
- double expected = 30.3;
-
- double actual = CurrencyConverter.SingaporeToSwiss(singapore);
-
- Assert.assertEquals(expected, actual, 0);
- }
-
- @Test
- public void SwissToMalaysian(){
- double Swiss = 50;
-
- double expected = 223.5;
-
- double actual = CurrencyConverter.SwissToMalaysian(Swiss);
-
- Assert.assertEquals(expected, actual, 0);
- }
-
- @Test
- public void MalaysianToJapaneseYen(){
- double malaysian = 50;
-
- double expected = 5792;
-
- double actual = CurrencyConverter.MalaysianToJapaneseYen(malaysian);
-
- Assert.assertEquals(expected, actual, 0);
- }
-
- @Test
- public void JapaneseYenToChinese(){
- double japan = 50;
-
- double expected = 346;
-
- double actual = CurrencyConverter.JapaneseYenToChinese(japan);
-
- Assert.assertEquals(expected, actual, 0);
- }
- }
|