コード例 #1
0
        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)));
        }
コード例 #2
0
 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)));
 }