Ejemplo n.º 1
0
        public void LogFileNotCreated()
        {
            Listeners.IListener listener = new MockListener();
            Viewers.IViewer     viewer   = new MockViewer();

            SessionMonitor s = new SessionMonitor(listener, viewer);

            s.Start();
            s.AddEvent(listener, "Some text");
            s.Stop();

            Assert.IsNull(s.logFileName);
        }
Ejemplo n.º 2
0
        public void LogFileCreated()
        {
            Viewers.IViewer     viewer   = new MockViewer();
            Listeners.IListener listener = new MockListener();
            SessionMonitor      s        = new SessionMonitor(listener, viewer, "foo_log.txt");

            s.Start();
            s.AddEvent(listener, "Some text");
            s.Stop();

            Assert.IsTrue(System.IO.File.Exists(s.logFileName));

            System.IO.File.Delete(s.logFileName);
        }