Пример #1
0
        void ShouldApplyDanceRatingsWhenSupplied()
        {
            var parser = new DanceInfoTagParser("WC [email protected]", "Social", "Swing");
            var tdis   = parser.GetTagDanceInfo().ToList();

            Assert.Single(tdis);
            Assert.Equal(3.5, tdis[0].FiveStarRating);
        }
Пример #2
0
        void ShouldApplyAppropriateCategoriesToDances()
        {
            var parser = new DanceInfoTagParser("WC Swing", "Social", "Standard", "Swing");
            var tdis   = parser.GetTagDanceInfo().ToList();

            Assert.Single(tdis);
            Assert.Equal(DanceCategories.Social | DanceCategories.Swing, tdis[0].Categories);
        }
Пример #3
0
        void ShouldApplyDefaultRatings()
        {
            var parser = new DanceInfoTagParser(127, DanceCategories.None, "Foxtrot", "Smooth", "Social");
            var tdis   = parser.GetTagDanceInfo().ToList();

            Assert.Single(tdis);
            Assert.True(tdis[0].RawRating.HasValue);
            Assert.Equal((uint)127, tdis[0].RawRating.Value);
        }
Пример #4
0
        void ShouldAllowMultipleDances()
        {
            var parser = new DanceInfoTagParser("Foxtrot", "WC Swing", "Smooth", "Social", "Swing");
            var tdis   = parser.GetTagDanceInfo().ToList();

            Assert.Equal(2, tdis.Count);
            var swing   = tdis.Single((t) => t.Dance == Dances.WestCoastSwing);
            var foxtrot = tdis.Single((t) => t.Dance == Dances.Foxtrot);

            Assert.Equal(DanceCategories.Social | DanceCategories.Swing, swing.Categories);
            Assert.Equal(DanceCategories.Social | DanceCategories.Smooth, foxtrot.Categories);
        }
Пример #5
0
        void ShouldApplyCategoryRatingsWhenSupplied()
        {
            var parser = new DanceInfoTagParser("WC [email protected]", "Social", "[email protected]");
            var tdis   = parser.GetTagDanceInfo().ToList();

            Assert.Equal(2, tdis.Count);
            var social = tdis.Single((t) => (t.Categories & DanceCategories.Social) != DanceCategories.None);
            var swing  = tdis.Single((t) => (t.Categories & DanceCategories.Swing) != DanceCategories.None);

            Assert.Equal(4.0, social.FiveStarRating);
            Assert.Equal(3.5, swing.FiveStarRating);
        }
Пример #6
0
        void ShouldMergeDefaultAndSuppliedRatings()
        {
            var defaultRating = TrackRating.FiveStarRatingToRaw(4.0);
            var parser        = new DanceInfoTagParser(defaultRating, DanceCategories.None, "WC [email protected]", "Foxtrot", "Smooth", "[email protected]", "Swing");
            var tdis          = parser.GetTagDanceInfo().ToList();

            Assert.Equal(4, tdis.Count);
            var foxtrots = tdis.Where((t) => t.Dance == Dances.Foxtrot);
            var smooth   = foxtrots.Single((t) => (t.Categories & DanceCategories.Smooth) != DanceCategories.None);
            var social   = foxtrots.Single((t) => (t.Categories & DanceCategories.Social) != DanceCategories.None);

            Assert.Equal(defaultRating, smooth.RawRating);
            Assert.Equal(3.5, social.FiveStarRating);

            var swings = tdis.Where((t) => t.Dance == Dances.WestCoastSwing);
            var swing  = swings.Single((t) => (t.Categories & DanceCategories.Swing) != DanceCategories.None);

            social = swings.Single((t) => (t.Categories & DanceCategories.Social) != DanceCategories.None);
            Assert.Equal(4.5, swing.FiveStarRating);
            Assert.Equal(3.5, social.FiveStarRating);
        }