public void ShouldLogCreatedEventToDebug() { System.IO.FileInfo fileInfo = new System.IO.FileInfo(GetType().Assembly.Location); FileSystemWatcher tested = new FileSystemWatcher(); MockLog log = new MockLog(tested); tested.OnCreated(tested, new System.IO.FileSystemEventArgs(System.IO.WatcherChangeTypes.Created, fileInfo.Directory.FullName, fileInfo.Name)); Assert.IsTrue(log.Any(x => x.Level == MockLog.Level.Debug && x.Message.Contains(fileInfo.FullName))); }
public void ShouldLogCreatedEventToDebug() { System.IO.FileInfo fileInfo = new System.IO.FileInfo(GetType().Assembly.Location); FileSystemWatcher tested = new FileSystemWatcher(); MockLog log = new MockLog(tested); tested.OnCreated(tested, new System.IO.FileSystemEventArgs(System.IO.WatcherChangeTypes.Created, fileInfo.Directory.FullName, fileInfo.Name)); Assert.IsTrue(log.Any(x => x.Level == MockLog.Level.Debug && x.Message.Contains(fileInfo.FullName))); }