public void IsAlarmWithinLimits() { // This test method will test whether the alarm values are in between the values 12f and 54f. // If the values fall in between 12 and 54 the test should pass. Assert.IsFalse(alarmTesterCreated.ValueOutsideLimits(13f)); Assert.IsFalse(alarmTesterCreated.ValueOutsideLimits(53f)); Assert.IsFalse(alarmTesterCreated.ValueOutsideLimits(41f)); }
public void AlarmDoesNotDetectMinusValues() { // This test should pass if the values detected in the setup is not equal to -2f (NW) var testModule = new Mock <IModule>(MockBehavior.Strict); testModule.Setup(a => a.LowerLimit).Returns(12f); testModule.Setup(b => b.Name).Returns("Test"); testModule.Setup(c => c.UpperLimit).Returns(54f); IAlarmTester alarmTesterCreated = new AlarmTester(testModule.Object); Assert.IsTrue(alarmTesterCreated.ValueOutsideLimits(-2f)); }
public void IsAlarmGreaterThanZero() { // This test should pass since the values setup is above 0. (NW) var testModule = new Mock <IModule>(MockBehavior.Strict); testModule.Setup(a => a.LowerLimit).Returns(12f); testModule.Setup(b => b.Name).Returns("Test"); testModule.Setup(c => c.UpperLimit).Returns(54f); IAlarmTester alarmTesterCreated = new AlarmTester(testModule.Object); Assert.IsTrue(alarmTesterCreated.ValueOutsideLimits(0f)); }
public void IsAlarmOutsideLimits() { /* This test method will test whether the values are outside the setup values 12f and 54f. * If they are outside the test should pass. If in between should fail. (NW) */ var testModule = new Mock <IModule>(MockBehavior.Strict); testModule.Setup(a => a.LowerLimit).Returns(12f); testModule.Setup(b => b.Name).Returns("Test"); testModule.Setup(c => c.UpperLimit).Returns(54f); IAlarmTester alarmTesterCreated = new AlarmTester(testModule.Object); Assert.IsTrue(alarmTesterCreated.ValueOutsideLimits(11f)); }
public void AlarmIsWithinLimits() { /* This test method will test whether the alarm values are in between the values 12f and 54f. * If the values fall in between 12 and 54 the test should pass. (NW) */ var testModule = new Mock <IModule>(MockBehavior.Strict); testModule.Setup(a => a.LowerLimit).Returns(12f); testModule.Setup(b => b.Name).Returns("Test"); testModule.Setup(c => c.UpperLimit).Returns(54f); IAlarmTester alarmTesterCreated = new AlarmTester(testModule.Object); Assert.IsFalse(alarmTesterCreated.ValueOutsideLimits(13f)); }
public void alarmInLimits() { Assert.IsFalse(createdAlarmTester.ValueOutsideLimits(15f)); Assert.IsFalse(createdAlarmTester.ValueOutsideLimits(11f)); Assert.IsFalse(createdAlarmTester.ValueOutsideLimits(19f)); }