public void TestCtor1()
 {
     using (var proxy = new LogFileSearchProxy(_scheduler, _logFile.Object, TimeSpan.Zero))
     {
         proxy.SearchTerm.Should().BeNull();
         proxy.Count.Should().Be(0);
     }
 }
        protected AbstractDataSource(ITaskScheduler taskScheduler, DataSource settings, TimeSpan maximumWaitTime)
        {
            if (taskScheduler == null)
                throw new ArgumentNullException("taskScheduler");
            if (settings == null) throw new ArgumentNullException("settings");
            if (settings.Id == Guid.Empty) throw new ArgumentException("settings.Id shall be set to an actually generated id");

            _taskScheduler = taskScheduler;
            _settings = settings;
            _maximumWaitTime = maximumWaitTime;
            _counter = new LogFileCounter();

            _logFile = new LogFileProxy(taskScheduler, maximumWaitTime);
            _search = new LogFileSearchProxy(taskScheduler, _logFile, maximumWaitTime);
            CreateSearch();
        }
        public void TestSearch1()
        {
            AddEntry("Hello World!");
            AddEntry("Foobar");

            using (var proxy = new LogFileSearchProxy(_scheduler, _logFile.Object, TimeSpan.Zero))
            {
                proxy.SearchTerm = "foobar";
                proxy.Property(x => x.Count).ShouldEventually().Be(1, TimeSpan.FromSeconds(5000000), "because we should be able to search through the file in a few seconds");

                proxy.Matches.Should().Equal(new[]
                    {
                        new LogMatch(1, new LogLineMatch(0, 6))
                    });
                proxy.Count.Should().Be(1);
            }
        }