public void StartMonitoringTest()
        {
            string filePath   = "/home/olamide/Projects/BrewLog/BrewLog/bin/Debug/brewing data/2018/september/9/";
            string brewNumber = "258";

            LiveBrewMonitor liveBrewMonitor = LiveBrewMonitor.GetInstance();

            liveBrewMonitor.StartMonitoring(filePath, "Maltina", brewNumber);

            Assert.IsTrue(liveBrewMonitor.IsMonitoring);
        }
Exemplo n.º 2
0
    private static void OnTimedEvent(Object source, ElapsedEventArgs e)
    {
        string filePath   = "/home/olamide/Projects/BrewLog/BrewLog/bin/Debug/brewing data/2018/september/9/";
        string brewNumber = "258";

        liveBrewMonitor.StartMonitoring(filePath, "Maltina", brewNumber);
        Console.WriteLine("Back in OnTimedEvent");
        Console.WriteLine("The Elapsed event was raised at {0:HH:mm:ss.fff}",
                          e.SignalTime);
        Console.WriteLine("After message");
        aTimer.Start();
    }
 //User Methods
 public void StartNewBrew(string startDate, string brandName, string brewNumber)
 {
     if (!_brews.ContainsKey(brewNumber))
     // if (!_brews.ContainsKey(brewNumber))
     {
         Brew brew = new Brew(startDate, brandName, brewNumber);
         if (liveBrewMonitor.BrewFileExists(brew))
         {
             _brews.Add(brewNumber, brew);
             string filePath = liveBrewMonitor.GetBrewFilePath(brew);
             liveBrewMonitor.StartMonitoring(filePath, brew.BrandName, brew.BrewNumber);
             Notify();
         }
     }
 }