public void Test_Reset_jumpPrime() { // Arrange int testVal = 1000; jumpPrime obj; bool expectedInitialIsActive = false; bool expectedFinalIsActive = true; int expectedOrigUpperPrime = 1009; int expectedOrigLowerPrime = 997; int expectedJumpUpperPrime = 1019; int expectedJumpLowerPrime = 1013; // Act obj = new jumpPrime(testVal); while (obj.getActiveStatus()) { obj.up(); } bool initialIsActive = obj.getActiveStatus(); int jumpUpperPrime = obj.up(); int jumpLowerPrime = obj.down(); obj.reset(testVal); // Assert Assert.AreEqual(expectedInitialIsActive, initialIsActive); Assert.AreEqual(expectedFinalIsActive, obj.getActiveStatus()); Assert.AreEqual(expectedOrigUpperPrime, obj.up()); Assert.AreEqual(expectedOrigLowerPrime, obj.down()); Assert.AreEqual(expectedJumpUpperPrime, jumpUpperPrime); Assert.AreEqual(expectedJumpLowerPrime, jumpLowerPrime); }
public void Test_ReviveWhileActive_PermanentDeactivation_jumpPrime() { // Arrange int testVal = 10000; jumpPrime obj; bool expectedInitialIsActive = false; bool expectedSecondIsActive = false; bool expectedFinalIsActive = false; // Act obj = new jumpPrime(testVal); obj.revive(); bool initialIsActive = obj.getActiveStatus(); obj.revive(); bool secondIsActive = obj.getActiveStatus(); obj.reset(testVal); bool finalIsActive = obj.getActiveStatus(); // Assert Assert.AreEqual(expectedInitialIsActive, initialIsActive); Assert.AreEqual(expectedSecondIsActive, secondIsActive); Assert.AreEqual(expectedFinalIsActive, finalIsActive); }
public void Test_Initialization_jumpPrime() { // Arrange int testVal = 999; jumpPrime obj; bool expectedActive = true; // Act obj = new jumpPrime(testVal); // Assert Assert.AreEqual(expectedActive, obj.getActiveStatus()); }
public void Test_Revive_jumpPrime() { // Arrange int testVal = 4002; jumpPrime obj; bool expectedInitialIsActive = false; bool expectedFinalIsActive = true; int originalLowerPrime = 4001; // Act obj = new jumpPrime(testVal); while (obj.getActiveStatus()) { obj.down(); } bool initialIsActive = obj.getActiveStatus(); obj.revive(); // Assert Assert.AreEqual(expectedInitialIsActive, initialIsActive); Assert.AreEqual(expectedFinalIsActive, obj.getActiveStatus()); Assert.AreNotEqual(originalLowerPrime, obj.down()); }