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

            var pd2 = new LockData();
            pd2.SetLockData(dataLine2);
            LockDataTestOK2(pd2);
        }
예제 #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;
 }
예제 #4
0
파일: Runner.cs 프로젝트: JCCK/LockMonitor
 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);
 }
예제 #5
0
 void LockDataTestOK2(LockData pd)
 {
     Assert.AreEqual(3.4f, pd.UpperLevel);
     Assert.AreEqual(1.5f, pd.LowerLevel);
     Assert.AreEqual(1.7f, pd.FlowRate);
 }