Improved filtering implemented.

This commit is contained in:
2014-05-16 18:23:18 -04:00
parent b2d57a9e5f
commit fe0bc4e9ff
14 changed files with 425 additions and 133 deletions
+11 -3
View File
@@ -2,9 +2,7 @@
using System.Linq;
using MileageTraker.Web.Models;
using MileageTraker.Web.Utility;
using MileageTraker.Web.ViewModels;
using MileageTraker.Web.ViewModels.CreateLog;
using MileageTraker.Web.ViewModels.Log;
using MiscUtil.Collections;
using NUnit.Framework;
using ImportLogViewModel = MileageTraker.Web.ViewModels.Log.ImportLogViewModel;
@@ -108,5 +106,15 @@ namespace Web.Tests.Utility
{
typeof (MileageLogType).ParseWithDisplayNames("None");
}
[Test]
public void YearMonthGroupTest()
{
var range = new Range<DateTime>(new DateTime(2011, 2, 4), new DateTime(2013, 6, 23));
var monthsBetween = range.FromStart(d => d.AddMonths(1));
var yearMonthList = CustomExtensions.YearMonthList(monthsBetween);
Assert.That(yearMonthList, Has.Count.EqualTo(3));
Assert.That(yearMonthList["2013"], Has.Count.EqualTo(6));
}
}
}