123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
-
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- /**
- * The test class WriteIFsTest.
- *
- * @author William Brown
- * @version 1.3 10/21/2018
- */
- public class WriteIFsTest
- {
- int x;
- int tt_t;
- int tt_s;
- int oo1, oo2;
- String ss;
-
- private static final double _0_5 = 0.5;
- private static final double _0_04 = 0.04;
-
- /**
- * Default constructor for test class WriteIFsTest
- */
- public WriteIFsTest()
- {
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- */
- @Before
- public void setUp()
- {
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- @After
- public void tearDown()
- {
- }
-
- @Test
- public void TestIfs()
- {
- WriteIFs writeIFs1 = new WriteIFs();
- writeIFs1.playerDied(true);
- assertEquals("Game Over!", writeIFs1.ss);
- }
-
-
- @Test
- public void TestTherm()
- {
- WriteIFs writeIFs1 = new WriteIFs();
- assertEquals("heating", writeIFs1.thermoSTAT(62));
- }
- @Test
- public void TestTherm1()
- {
- WriteIFs writeIFs1 = new WriteIFs();
- assertEquals("cooling", writeIFs1.thermoSTAT(81));
- }
- @Test
- public void TestCheckFuel1()
- {
- WriteIFs writeIFs1 = new WriteIFs();
- writeIFs1.checkFuel(_0_5);
- assertEquals(0, writeIFs1.x);
- }
- @Test
- public void TestCheckFuel2()
- {
- WriteIFs writeIFs1 = new WriteIFs();
- writeIFs1.checkFuel(_0_04);
- assertEquals(99, writeIFs1.x);
- }
- @Test
- public void TestFireControl()
- {
- WriteIFs writeIFs1 = new WriteIFs();
- Object oo = new Object();
- writeIFs1.tt_s = 1;
- writeIFs1.fireplaceControl(oo);
- assertEquals(213, writeIFs1.tt_s);
- }
- @Test
- public void TestFireControl2()
- {
- WriteIFs writeIFs1 = new WriteIFs();
- Object oo = new Object();
- writeIFs1.oo1 = 65;
- writeIFs1.tt_s = 1;
- writeIFs1.fireplaceControl(oo);
- assertEquals(213, writeIFs1.tt_s);
- }
- @Test
- public void TestFireControl3()
- {
- WriteIFs writeIFs1 = new WriteIFs();
- Object oo = new Object();
- writeIFs1.oo2 = 80;
- writeIFs1.tt_s = 1;
- writeIFs1.fireplaceControl(oo);
- assertEquals(213, writeIFs1.tt_s);
- }
-
- }
-
-
-
-
|