Beispiel #1
0
        public void TestCreateChildrenShouldNotCreateNullLeafIfColumnHasNoNulls()
        {
            var column = new ColumnBuilder()
                         .WithValue(DateTime.MinValue)
                         .WithValue(DateTime.MinValue)
                         .Build();
            var root   = new DateTimeFilterTreeRoot(string.Empty, column);
            var result = root.CreateChildren();

            Assert.That(result.Count(), Is.EqualTo(0));
        }
Beispiel #2
0
        private void Test(DateTime lower, DateTime upper, int index, string name)
        {
            var column = new ColumnBuilder()
                         .WithValue(lower)
                         .WithValue(upper)
                         .Build();
            var root   = new DateTimeFilterTreeRoot(string.Empty, column);
            var result = root.CreateChildren();

            Assert.That(result.ElementAt(index).Name, Is.EqualTo(name));
            //TODO: Assert value
        }
Beispiel #3
0
        public void TestCreateChildrenShouldCreateNullLeafIfColumnHasNulls()
        {
            var column = new ColumnBuilder()
                         .WithValue(DateTime.MinValue)
                         .WithValue(DateTime.MinValue)
                         .WithNulls()
                         .Build();
            var root   = new DateTimeFilterTreeRoot(string.Empty, column);
            var result = root.CreateChildren();

            Assert.That(result.Single() is NullFilterTreeLeaf);
        }
Beispiel #4
0
        public void TestCreateChildrenShouldCreateChildren(string span, Type type)
        {
            var timeSpan = TimeSpan.Parse(span);
            var column   = new ColumnBuilder()
                           .WithValue(DateTime.MinValue)
                           .WithValue(DateTime.MinValue + timeSpan)
                           .Build();
            var root   = new DateTimeFilterTreeRoot(string.Empty, column);
            var result = root.CreateChildren();

            Assert.That(result.First(), Is.TypeOf(type));
        }