public void TestMapInverseReturnsNullWhenResultIsNotANumber()
        {
            var map    = new DateTimeToSizeMap(DateTime.MinValue, DateTime.MaxValue, 0d, 0d, SortOrder.Ascending);
            var result = map.MapInverse(0d);

            Assert.That(result, Is.Null);
        }
        public void TestMapInverseWithNullValue()
        {
            var map    = new DateTimeToSizeMap(DateTime.MinValue, DateTime.MaxValue, 0d, 1d, SortOrder.Ascending);
            var result = map.MapInverse(null);

            Assert.That(result, Is.Null);
        }
        public void TestMapInverseWithOutOfRangeValues(double value, string expected)
        {
            var map          = new DateTimeToSizeMap(DateTime.MinValue, DateTime.MaxValue, 0d, 1d, SortOrder.Ascending);
            var expectedDate = DateTime.Parse(expected);
            var result       = map.MapInverse(value);

            Assert.That(result, Is.EqualTo(expectedDate).Within(TimeSpan.FromMilliseconds(1)));
        }
        public void TestMapInverseWithMillisecondValues(double value, string 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 expectedDate = DateTime.Parse(expected);
            var result       = map.MapInverse(value);

            Assert.That(result, Is.EqualTo(expectedDate));
        }