Example #1
0
 public void LockDataCreatedCorrectly()
 {
     var pd = new LockData (dataLine1);
     LockDataTestOK1(pd);
     var pd2 = new LockData (dataLine2);
     LockDataTestOK2(pd2);
 }
Example #2
0
        public void LockDataSetCorrectly()
        {
            var pd = new LockData();
            pd.SetLockData(dataLine1);
            LockDataTestOK1(pd);

            var pd2 = new LockData();
            pd2.SetLockData(dataLine2);
            LockDataTestOK2(pd2);
        }
Example #3
0
 public Object CreateandReturnObj(LockClassesEnumeration objectToGet)
 {
     object createdObject = null;
     switch (objectToGet)
     {
     case LockClassesEnumeration.LockAlarmer:
         LockAlarmer alarmer = new LockAlarmer();
         createdObject = alarmer;
         break;
     case LockClassesEnumeration.LockDataReader:
         LockDataReader dataReader = new LockDataReader();
         createdObject = dataReader;
         break;
     case LockClassesEnumeration.LockData:
         LockData lockData = new LockData();
         createdObject = lockData;
         break;
     default:
         throw new ArgumentException("Invalid parameter passed");
     }
     return createdObject;
 }
Example #4
0
 void updateUI(object source, ElapsedEventArgs e)
 {
     lockData = new LockData (levelReader.getData ());
     Console.Clear();
     Console.WriteLine("Upper level {0}\nLower Level {1}\nFlow Rate {2}", lockData.UpperLevel,lockData.LowerLevel,lockData.FlowRate);
 }
Example #5
0
 void LockDataTestOK2(LockData pd)
 {
     Assert.AreEqual(3.4f, pd.UpperLevel);
     Assert.AreEqual(1.5f, pd.LowerLevel);
     Assert.AreEqual(1.7f, pd.FlowRate);
 }