public void TestCategoryRangeItemDouble() { // arrange var ri = new CategoryThemeRangeItem <double> { LowerBound = 5.01, UpperBound = 9.99, Style = VectorStyle.CreateRandomStyle() }; // act // assert Assert.That(ri, Is.Not.Null); Assert.That(ri.Title, Is.EqualTo(string.Format("{0} - {1}", 5.01, 9.99))); ri.Title = "[5.01 - 9.99["; Assert.That(ri.Title, Is.EqualTo("[5.01 - 9.99[")); Assert.That(ri.Matches(5), Is.False); Assert.That(ri.Matches(5.01), Is.True); Assert.That(ri.Matches(6), Is.True); Assert.That(ri.Matches(9), Is.True); Assert.That(ri.Matches(9.99), Is.False); Assert.That(ri.Matches(10), Is.False); Assert.That(ri.Style != null, Is.True); }
public void TestCategoryRangeItemInt32() { // arrange var ri = new CategoryThemeRangeItem <int> { LowerBound = 5, UpperBound = 10, Style = VectorStyle.CreateRandomStyle() }; // act // assert Assert.That(ri, Is.Not.Null); Assert.That(ri.Title, Is.EqualTo("5 - 10")); ri.Title = "[5, 10["; Assert.That(ri.Title, Is.EqualTo("[5, 10[")); Assert.That(ri.Matches(4), Is.False); Assert.That(ri.Matches(5), Is.True); Assert.That(ri.Matches(6), Is.True); Assert.That(ri.Matches(9), Is.True); Assert.That(ri.Matches(10), Is.False); Assert.That(ri.Matches(11), Is.False); }