Ejemplo n.º 1
0
        public void ShouldPopulateFilterTracksFromLibrary()
        {
            var defaultFilter = new TrackDanceFilter()
            {
                Categories   = DanceCategories.None,
                ReviewStatus = DanceReviewStatusFlags.Any,
                Difficulty   = DanceDifficulty.Any
            };
            var lib = new LibraryFilter(SampleData.GetTestLibrary(), defaultFilter);

            lib.AddDanceFiltersByCategory(Dance.AllCategories);
            foreach (var fi in lib.AllFilters)
            {
                foreach (var dance in fi.Filter.Dances)
                {
                    var edi = SampleData.ExpectedDanceInfo[dance];
                    foreach (var category in Dance.EnumerateCategories(fi.Filter.Categories))
                    {
                        var expected = edi.GetTotalForCategory(category);
                        Assert.Equal(expected, fi.Tracks.Count);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 protected DanceViewModel(Dance dance)
 {
     Dance      = dance;
     Categories = dance.EnumerateCategories().ToArray();
 }