Beispiel #1
0
        public void TestMoveBefore4()
        {
            var dataSources = new DataSources();
            var a           = new DataSource(@"A");
            var b           = new DataSource(@"B");

            dataSources.Add(a);
            new Action(() => dataSources.MoveBefore(a, b)).ShouldNotThrow();
            dataSources.Should().Equal(a);
            new Action(() => dataSources.MoveBefore(b, a)).ShouldNotThrow();
            dataSources.Should().Equal(a);
        }
Beispiel #2
0
        public void TestMoveBefore2()
        {
            var dataSources = new DataSources();
            var a           = new DataSource(@"A");
            var b           = new DataSource(@"B");

            dataSources.Add(a);
            dataSources.Add(b);
            dataSources.MoveBefore(a, b);
            dataSources.Should().Equal(a, b);
        }
 public void TestAddGroup1()
 {
     var settings = new Tailviewer.Settings.DataSources();
     using (var dataSources = new Tailviewer.BusinessLogic.DataSources.DataSources(_scheduler, settings))
     {
         MergedDataSource group = dataSources.AddGroup();
         group.Should().NotBeNull();
         group.Settings.Should().NotBeNull();
         settings.Should().Equal(group.Settings);
     }
 }
Beispiel #4
0
        public void TestAddGroup1()
        {
            var settings = new Tailviewer.Settings.DataSources();

            using (var dataSources = new Tailviewer.BusinessLogic.DataSources.DataSources(_logFileFactory, _scheduler, settings))
            {
                MergedDataSource group = dataSources.AddGroup();
                group.Should().NotBeNull();
                group.Settings.Should().NotBeNull();
                settings.Should().Equal(group.Settings);
            }
        }
Beispiel #5
0
        public void TestRemove()
        {
            SingleDataSource source1 = _dataSources.AddDataSource(@"E:\Code\test1.log");
            SingleDataSource source2 = _dataSources.AddDataSource(@"E:\Code\test2.log");

            _dataSources.Remove(source1);
            _settings.Count.Should().Be(1);
            _settings[0].File.Should().Be(@"E:\Code\test2.log");

            _dataSources.Remove(source2);
            _settings.Should().BeEmpty();
        }