Example #1
0
        protected override void beforeEach()
        {
            theFileWatcher = new NulloSpecFileWatcher();
            Services.Inject <ISpecFileWatcher>(theFileWatcher);

            ClassUnderTest.StartWatching(thePath);
        }
        public void CopyFiles()
        {
            var path = TestingContext.FindParallelDirectory("Storyteller.Samples").AppendPath("Specs");


#if NET46
            var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
#else
            var baseDirectory = AppContext.BaseDirectory;
#endif

            thePath = baseDirectory.ToFullPath().AppendPath(Guid.NewGuid().ToString());
            var fileSystem = new FileSystem();

            var files = fileSystem.FindFiles(path, FileSet.Deep("*.md"));
            files.Each(file =>
            {
                var relativePath = file.PathRelativeTo(path);
                var destination  = Path.Combine(thePath, relativePath);

                fileSystem.Copy(file, destination);
            });

            theFileWatcher = new NulloSpecFileWatcher();
            Services.Inject <ISpecFileWatcher>(theFileWatcher);

            ClassUnderTest.StartWatching(thePath);
        }