ConsoleTest.java 1010B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import static org.junit.Assert.*;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. /**
  6. * The test class ConsoleTest.
  7. *
  8. * @author (your name)
  9. * @version (a version number or a date)
  10. */
  11. public class ConsoleTest
  12. {
  13. Console test = new Console();
  14. @Test
  15. public void mPlusTest(){
  16. //Given
  17. double test1 = 1.0;
  18. //When
  19. double actual = 1.0;
  20. double expected = test.mPlus(test1);
  21. //Then
  22. assertEquals(expected,actual,0);
  23. }
  24. @Test
  25. public void mClearTest(){
  26. //Given
  27. test.memory = 5.0;
  28. //When
  29. double actual =0.0;
  30. double expected = test.mClear();
  31. //Then
  32. assertEquals(expected,actual,0);
  33. }
  34. @Test
  35. public void mRcTest(){
  36. //Given
  37. double test1 = 0.0;
  38. //When
  39. double actual = 0.0;
  40. double expected = test.mRc();
  41. //Then
  42. assertEquals(expected,actual,0);
  43. }
  44. }