예제 #1
0
        public HtmlFileWriterTest()
        {
            _reader = new ConfigurationReader();
            IFileSystemHelper fsh = (IFileSystemHelper)(new Mock <FileSystemHelper>().Object);

            _xfr = new XmlFileReader(_reader.GetXmlFilesDirectory(), _reader.GetXmlFilesProcessedDirectory(), fsh);
            _hfw = new HtmlFileWriter(_reader.GetHtmlFilesDirectory(), _reader.GetResourcesDirectory(), fsh);
        }
예제 #2
0
 public void Process()
 {
     Thread.Sleep(100);
     do
     {
         //_producerConsumer.lollypop.WaitOne();
         HtmlFileWriter hfw  = new HtmlFileWriter(_producerConsumer.GetConfigurationReader().GetHtmlFilesDirectory(), _producerConsumer.GetConfigurationReader().GetResourcesDirectory(), _producerConsumer.FileSystemHelper);
         IStackItem     item = null;
         while (_producerConsumer.Queue.TryDequeue(out item))
         {
             hfw.WriteHtmlFile(item);
             // do stuff
         }
         _producerConsumer.IsDoneWriting = true;
     } while (!_producerConsumer.IsDoneReading || !_producerConsumer.Queue.IsEmpty);
 }