Exemplo n.º 1
0
        public void ShouldLogRenamedEventToDebug()
        {
            System.IO.FileInfo fileInfo = new System.IO.FileInfo(GetType().Assembly.Location);
            FileSystemWatcher  tested   = new FileSystemWatcher();
            MockLog            log      = new MockLog(tested);

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