public void TestUpdate3()
        {
            var dataSource1 = new Mock <IFileDataSource>();

            dataSource1.Setup(x => x.FilteredLogSource).Returns(new Mock <ILogSource>().Object);
            dataSource1.Setup(x => x.UnfilteredLogSource).Returns(new Mock <ILogSource>().Object);
            var dataSource2 = new Mock <IFileDataSource>();

            dataSource2.Setup(x => x.FilteredLogSource).Returns(new Mock <ILogSource>().Object);
            dataSource2.Setup(x => x.UnfilteredLogSource).Returns(new Mock <ILogSource>().Object);

            _dataSources.Setup(x => x.Sources).Returns(new List <IDataSource> {
                dataSource1.Object, dataSource2.Object
            });
            var model = new LogViewMainPanelViewModel(_services, _actionCenter.Object, _dataSources.Object, _quickFilters.Object, _highlighters.Object, _settings.Object);

            model.RecentFiles.Should().HaveCount(2);

            dataSource1.Setup(x => x.NoTimestampCount).Returns(42);
            dataSource2.Setup(x => x.NoTimestampCount).Returns(9001);

            model.Update();
            var viewModel1 = model.RecentFiles.First();

            viewModel1.NoTimestampCount.Should().Be(42);
            var viewModel2 = model.RecentFiles.Last();

            viewModel2.NoTimestampCount.Should().Be(9001);
        }
        public void TestUpdate2()
        {
            var model = new LogViewMainPanelViewModel(_services, _actionCenter.Object, _dataSources.Object, _quickFilters.Object, _highlighters.Object, _settings.Object);
            var dataSourceViewModel = new Mock <IDataSourceViewModel>();
            var dataSource          = new Mock <IDataSource>();
            var logFile             = new InMemoryLogSource();

            dataSource.Setup(x => x.UnfilteredLogSource).Returns(logFile);
            var filteredLogFile = new InMemoryLogSource();

            dataSource.Setup(x => x.FilteredLogSource).Returns(filteredLogFile);
            dataSourceViewModel.Setup(x => x.DataSource).Returns(dataSource.Object);
            model.CurrentDataSource = dataSourceViewModel.Object;

            logFile.AddEntry("", LevelFlags.All);
            logFile.SetValue(Properties.Size, Size.OneByte);
            model.Update();
            model.CurrentDataSourceLogView.NoEntriesExplanation.Should().Be("Nothing matches level filter");
        }
        public void TestUpdate1()
        {
            var model = new LogViewMainPanelViewModel(_services, _actionCenter.Object, _dataSources.Object, _quickFilters.Object, _highlighters.Object, _settings.Object);

            new Action(() => model.Update()).Should().NotThrow();
        }
 private void TimerOnTick(object sender, EventArgs eventArgs)
 {
     _logViewPanel?.Update();
     _actionCenterViewModel.Update();
 }