/// <summary> /// Executes when a Stop command is sent to this service. /// </summary> protected override void OnStop() { WriteLogEntry( "Stop command issued - disposing of objects now.", EventLogEntryType.Information ); DatabaseConnection.Dispose(); FileSystemMonitor.Dispose(); Log.Dispose(); WriteLogEntry( "Stop complete.", EventLogEntryType.Information ); }
public void PathNullTest() { ArgumentNullException expected = null; FileSystemMonitor target = new FileSystemMonitor(); try { target.Path = null; } catch (ArgumentNullException ex) { expected = ex; } target.Dispose(); Assert.IsTrue(expected != null); }