Пример #1
0
 public Runner()
 {
     levelReader = new LockDataReader (DATA_FILE);
     readTimer = new Timer ();
     readTimer.Interval = 2000;
     readTimer.Elapsed += updateUI;
 }
Пример #2
0
 public void GoodUnconnectedCreation()
 {
     var pdr = new LockDataReader();
     pdr.Connect(@"..\..\..\TestData.csv");
     Assert.AreEqual(dataLine1, pdr.getData());
     Assert.AreEqual(dataLine2, pdr.getData());
 }
Пример #3
0
 void setupComponents()
 {
     _lockData = (LockData)_lockFactory.CreateandReturnObj (LockClassesEnumeration.LockData);
     _dataReader = (LockDataReader)_lockFactory.CreateandReturnObj (LockClassesEnumeration.LockDataReader);
     _alarmer = (LockAlarmer)_lockFactory.CreateandReturnObj (LockClassesEnumeration.LockAlarmer);
     _alarmer.UpperLevelAlarm += new EventHandler(soundMutableAlarm);
     _alarmer.LowerLevelAlarm += new EventHandler(soundMutableAlarm);
     _alarmer.FlowRateAlarm += new EventHandler(soundMutableAlarm);
     _tickTimer.Stop ();
     _tickTimer.Interval = TimeSpan.FromMilliseconds (1000);
     _tickTimer.Tick += new EventHandler (updateReadings);
 }
Пример #4
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;
 }
Пример #5
0
 public void BadUnconnectedFileName()
 {
     var pdr = new LockDataReader();
     pdr.Connect(@"..\..\..\NonExistant.csv");
 }