public void TestMapWithNullValue() { var map = new DateTimeToSizeMap(DateTime.MinValue, DateTime.MaxValue, 0d, 100d, SortOrder.Ascending); var result = map.Map(null); Assert.That(result, Is.Null); }
public void TestMapWithDescendingValues(string date, double expected) { var map = new DateTimeToSizeMap(DateTime.MinValue, DateTime.MaxValue, 0d, 1d, SortOrder.Descending); var value = DateTime.Parse(date); var result = map.Map(value); Assert.That(result, Is.EqualTo(expected).Within(0.0001)); }
public void TestMapWithMillisecondValues(string time, double expected) { var min = DateTime.Parse("1/1/0001 00:00:00.000"); var max = DateTime.Parse("1/1/0001 00:00:01.000"); var map = new DateTimeToSizeMap(min, max, 0d, 1d, SortOrder.Ascending); var value = DateTime.Parse(time); var result = map.Map(value); Assert.That(result, Is.EqualTo(expected).Within(0.0001)); }