public void TestCreateChildrenShouldCreateMidValueNodes() { var values = CreateValues(-10, 20, 1d);; _column = new ColumnBuilder().WithValues(values).Build(); _node = new FloatFilterTreeNode(string.Empty, _column, (double)_column.Min, (double)_column.Max); var results = _node.CreateChildren(); Assert.That(results.ElementAt(5).Name, Is.EqualTo("0 - 1")); }
public void TestCreateChildrenShouldReturnNodesIfMoreThanTenNodes() { var values = CreateValues(0d, 20, 1d); _column = new ColumnBuilder().WithValues(values).Build(); _node = new FloatFilterTreeNode(string.Empty, _column, 0d, 20d); var result = _node.CreateChildren(); Assert.That(result.All(p => p is FloatFilterTreeNode)); }
public void TestCreateChildrenShouldCreateMaxValueLeaf() { var value = double.MaxValue; _column = new ColumnBuilder().WithValue(value).Build(); _node = new FloatFilterTreeNode(string.Empty, _column, value, value); var results = _node.CreateChildren(); Assert.That(results.Single().Name, Is.EqualTo("1.79769313486232E+308")); }
public void TestCreateChildrenShouldCreateMinValueNodes() { var step = Double.MaxValue / 20d; var values = CreateValues(Double.MinValue, 20, step);; _column = new ColumnBuilder().WithValues(values).Build(); _node = new FloatFilterTreeNode(string.Empty, _column, (double)_column.Min, (double)_column.Max); var results = _node.CreateChildren(); Assert.That(results.First().Name, Is.EqualTo("-1.79769313486232E+308 - -1.7078084781192E+308")); }
public void TestCreateFilterShouldReturnFilter() { var lowerValue = double.MinValue; var upperValue = double.MaxValue; _node = new FloatFilterTreeNode(string.Empty, _column, lowerValue, upperValue); var result = (FloatFilter)_node.CreateFilter(); Assert.That(result.LowerValue, Is.EqualTo(lowerValue)); Assert.That(result.UpperValue, Is.EqualTo(upperValue)); }