Cleanup tests.
This commit is contained in:
parent
65dcbcc4e3
commit
0e04a40a76
3 changed files with 16 additions and 11 deletions
|
@ -44,11 +44,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
* @since 1.0
|
||||
*/
|
||||
public class CalcTest {
|
||||
@Test
|
||||
public void testCalcImpl() {
|
||||
AbstractModuleTest.testAbstractModule(new Calc());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCalc() {
|
||||
assertThat(Calc.calc("1 + 1")).as("calc(1+1)").isEqualTo("1+1 = 2");
|
||||
|
@ -56,4 +51,9 @@ public class CalcTest {
|
|||
assertThat(Calc.calc("pi+π+e+φ")).as("calc(pi+π+e+φ)").isEqualTo("pi+π+e+φ = 10.62");
|
||||
assertThat(Calc.calc("one + one")).as("calc(one + one)").startsWith("No idea.");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCalcImpl() {
|
||||
AbstractModuleTest.testAbstractModule(new Calc());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
import net.thauvin.erik.mobibot.msg.ErrorMessage;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
@ -55,9 +57,12 @@ public class CurrencyConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressFBWarnings("PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS")
|
||||
public void testConvertCurrency() throws ModuleException {
|
||||
assertThat(CurrencyConverter.convertCurrency("100 USD to EUR").getMessage())
|
||||
.as("100 USD to EUR").startsWith("100.00 USD = ");
|
||||
assertThat(CurrencyConverter.convertCurrency("100 USD to USD"))
|
||||
.as("100 USD to USD").isInstanceOf(ErrorMessage.class);
|
||||
assertThat(CurrencyConverter.convertCurrency(CurrencyConverter.CURRENCY_RATES_KEYWORD).isNotice())
|
||||
.as(CurrencyConverter.CURRENCY_RATES_KEYWORD + " is notice").isTrue();
|
||||
assertThat(CurrencyConverter.convertCurrency(CurrencyConverter.CURRENCY_RATES_KEYWORD).getMessage())
|
||||
|
|
|
@ -44,15 +44,15 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
* @since 1.0
|
||||
*/
|
||||
public class WordTimeTest {
|
||||
@Test
|
||||
public void testWorldTimeImpl() {
|
||||
AbstractModuleTest.testAbstractModule(new Lookup());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWorldTime() {
|
||||
assertThat(WorldTime.worldTime("PST").getMessage()).as("PST").startsWith("The time is ");
|
||||
assertThat(WorldTime.worldTime("PST").getMessage()).as("PST").endsWith("Los Angeles");
|
||||
assertThat(WorldTime.worldTime("BLAH").isError()).as("BLAH").isTrue();
|
||||
assertThat(WorldTime.worldTime("BEATS").getMessage()).as("BEATS").contains("@");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWorldTimeImpl() {
|
||||
AbstractModuleTest.testAbstractModule(new Lookup());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue