Beispiel #1
0
 public void OneTimeSetUp()
 {
     _scheduler      = new ManualTaskScheduler();
     _logFileFactory = new PluginLogFileFactory(_scheduler);
     _filesystem     = new InMemoryFilesystem();
     _actionCenter   = new Mock <IActionCenter>();
 }
        public void SetUp()
        {
            _settings         = new ApplicationSettings("adwad");
            _bookmarks        = new Bookmarks("aawdwa");
            _dispatcher       = new ManualDispatcher();
            _scheduler        = new ManualTaskScheduler();
            _logSourceFactory = new SimplePluginLogSourceFactory(_scheduler);
            _filesystem       = new InMemoryFilesystem();
            _dataSources      = new DataSources(_logSourceFactory, _scheduler, _filesystem, _settings.DataSources, _bookmarks);
            _quickFilters     = new QuickFilters(_settings.QuickFilters);
            _actionCenter     = new ActionCenter();
            _updater          = new Mock <IAutoUpdater>();

            _services = new ServiceContainer();
            _services.RegisterInstance <ITaskScheduler>(_scheduler);
            _services.RegisterInstance <IDispatcher>(_dispatcher);
            _services.RegisterInstance <IPluginLoader>(new PluginRegistry());
            _services.RegisterInstance <IHighlighters>(new HighlighterCollection());
            _services.RegisterInstance <INavigationService>(new NavigationService());
            _services.RegisterInstance <IPluginUpdater>(new Mock <IPluginUpdater>().Object);

            _mainWindow = new MainWindowViewModel(_services,
                                                  _settings,
                                                  _dataSources,
                                                  _quickFilters,
                                                  _actionCenter,
                                                  _updater.Object);
        }
Beispiel #3
0
        public void Setup()
        {
            _operationTracker = new OperationTracker();
            _fileSystem       = new InMemoryFilesystem();
            _node             = new LocalNode(_operationTracker, _fileSystem);

            _fileSystem.AddRoot(Path.GetPathRoot(Path.GetTempPath()));
            _fileSystem.CreateDirectory(Path.GetTempPath());
        }
Beispiel #4
0
 public void SetUp()
 {
     _taskScheduler  = new ManualTaskScheduler();
     _logFileFactory = new PluginLogFileFactory(_taskScheduler);
     _filesystem     = new InMemoryFilesystem();
     _settings       = new DataSource
     {
         Id = DataSourceId.CreateNew(),
         MergedDataSourceDisplayMode = DataSourceDisplayMode.CharacterCode
     };
 }
        public void SetUp()
        {
            _settings  = new Tailviewer.Settings.DataSourceSettings();
            _bookmarks = new Mock <IBookmarks>();

            _scheduler      = new ManualTaskScheduler();
            _logFileFactory = new PluginLogFileFactory(_scheduler);
            _filesystem     = new InMemoryFilesystem();
            _dataSources    = new DataSources(_logFileFactory, _scheduler, _filesystem, _settings, _bookmarks.Object);
            _actionCenter   = new Mock <IActionCenter>();
        }
        public void Setup()
        {
            _taskScheduler = new ManualTaskScheduler();
            _filesystem    = new InMemoryFilesystem(new ImmediateTaskScheduler());

            var root = Path.GetPathRoot(Constants.AnalysisDirectory);

            _filesystem.AddRoot(root);

            _logAnalyserEngine = new Mock <ILogAnalyserEngine>();
            _storage           = new AnalysisStorage(_taskScheduler,
                                                     _filesystem,
                                                     _logAnalyserEngine.Object);
        }
Beispiel #7
0
        public void TestAddPluginNoSuchDirectory()
        {
            var app = new AddPlugin();

            var filesystem = new InMemoryFilesystem();
            var repo       = new Mock <IInternalPluginRepository>();

            app.Run(filesystem, repo.Object, new AddPluginOptions
            {
                PluginFileName = @"M:\does\not\exist.tvp"
            }).Should().Be(ExitCode.DirectoryNotFound);

            repo.Verify(x => x.PublishPlugin(It.IsAny <byte[]>(), It.IsAny <string>()), Times.Never);
            repo.Verify(x => x.PublishPlugin(It.IsAny <byte[]>(), It.IsAny <string>(), It.IsAny <string>()), Times.Never);
        }
        public void Setup()
        {
            _pluginFolder = Path.Combine(Path.GetDirectoryName(AssemblyFileName), "Plugins", "PluginArchiveLoaderTest");
            if (!Directory.Exists(_pluginFolder))
            {
                Directory.CreateDirectory(_pluginFolder);
            }
            else
            {
                DeleteContents(_pluginFolder);
            }

            _filesystem = new InMemoryFilesystem();
            _filesystem.AddRoot(Path.GetPathRoot(Constants.PluginPath));
            _filesystem.CreateDirectory(Constants.PluginPath);
        }
        public void Setup()
        {
            _taskScheduler = new ManualTaskScheduler();
            _filesystem    = new InMemoryFilesystem(new ImmediateTaskScheduler());

            var root = Path.GetPathRoot(Constants.AnalysisDirectory);

            _filesystem.AddRoot(root);

            _logAnalyserEngine = new Mock <ILogAnalyserEngine>();

            _typeFactory = new TypeFactory();
            _typeFactory.Add(typeof(ActiveAnalysisConfiguration));
            _typeFactory.Add(typeof(AnalyserTemplate));
            _typeFactory.Add(typeof(PageTemplate));
            _typeFactory.Add(typeof(WidgetTemplate));
        }
Beispiel #10
0
        public void Setup()
        {
            _taskScheduler = new ManualTaskScheduler();
            _filesystem    = new InMemoryFilesystem(new ImmediateTaskScheduler());

            var root = Path.GetPathRoot(Constants.AnalysisDirectory);

            _filesystem.AddRoot(root);

            _dataSourceAnalyserEngine = new Mock <IDataSourceAnalyserEngine>();

            _typeFactory = new TypeFactory();
            _typeFactory.Add <AnalysisTemplate>();
            _typeFactory.Add <AnalysisViewTemplate>();
            _typeFactory.Add <ActiveAnalysisConfiguration>();
            _typeFactory.Add <AnalyserTemplate>();
            _typeFactory.Add <PageTemplate>();
            _typeFactory.Add <WidgetTemplate>();
        }
Beispiel #11
0
        public void TestAddPluginNoSuchFile()
        {
            var filesystem = new InMemoryFilesystem();
            var path       = @"M:\does\not\exist\";

            filesystem.CreateDirectory(path);

            var repo = new Mock <IInternalPluginRepository>();
            var file = Path.Combine(path, "plugin.tvp");

            var app = new AddPlugin();

            app.Run(filesystem, repo.Object, new AddPluginOptions
            {
                PluginFileName = file
            }).Should().Be(ExitCode.FileNotFound);

            repo.Verify(x => x.PublishPlugin(It.IsAny <byte[]>(), It.IsAny <string>()), Times.Never);
            repo.Verify(x => x.PublishPlugin(It.IsAny <byte[]>(), It.IsAny <string>(), It.IsAny <string>()), Times.Never);
        }
Beispiel #12
0
 public void OneTimeSetUp()
 {
     _scheduler        = new ManualTaskScheduler();
     _logSourceFactory = new SimplePluginLogSourceFactory(_scheduler);
     _filesystem       = new InMemoryFilesystem();
 }
Beispiel #13
0
 public void Setup()
 {
     _filesystem = new InMemoryFilesystem();
 }
Beispiel #14
0
 public void Setup()
 {
     _filesystem = new InMemoryFilesystem();
     _assemblyDocumentationCreator = new AssemblyDocumentationCreator(typeof(EmptyType).Assembly);
 }
Beispiel #15
0
 public void Setup()
 {
     _fileSystem = new InMemoryFilesystem();
     _fileSystem.AddRoot(@"C:\");
 }
Beispiel #16
0
 public void Setup()
 {
     _filesystem = new InMemoryFilesystem();
     _filesystem.CurrentDirectory = _filesystem.Roots.First().FullName;
 }