Exemple #1
0
        public void MapTopItemWithPartitionKeyToOverallEntryEvolution_Evolution_Different()
        {
            var entryArtistImageProvider = new Mock <IEntryArtistImageProvider>();

            entryArtistImageProvider.Setup(m => m.GetPictureUrl("abc")).Returns("http://myownrepo/a/abc.jpg");

            var mapTopItemToOverallEntryEvolution = new MapTopItemWithPartitionKeyToOverallEntryEvolution(new MapTopItemWithPartitionKeyToPosition(), entryArtistImageProvider.Object);
            var overallEntreyEvolyion             = mapTopItemToOverallEntryEvolution.Map
                                                        (new TopItemWithPartitionKey
            {
                Key        = "date1",
                Id         = "abc",
                DayRanking = 1,
                Hits       = 12,
                Loved      = 1,
                Score      = 44
            },
                                                        new TopItemWithPartitionKey
            {
                Key        = "date1",
                Id         = "abcd",
                DayRanking = 2,
                Hits       = 10,
                Loved      = 1,
                Score      = 30
            });
        }
Exemple #2
0
        public void MapTopItemWithPartitionKeyToOverallEntryEvolution_Evolution_NewEntry()
        {
            var entryArtistImageProvider = new Mock <IEntryArtistImageProvider>();

            entryArtistImageProvider.Setup(m => m.GetPictureUrl("abc")).Returns("http://myownrepo/a/abc.jpg");

            var mapTopItemToOverallEntryEvolution = new MapTopItemWithPartitionKeyToOverallEntryEvolution(new MapTopItemWithPartitionKeyToPosition(), entryArtistImageProvider.Object);
            var overallEntreyEvolyion             = mapTopItemToOverallEntryEvolution.Map
                                                    (
                new TopItemWithPartitionKey
            {
                Key        = "date1",
                Id         = "abc",
                DayRanking = 1,
                Hits       = 12,
                Loved      = 1,
                Score      = 44
            },
                null);

            Assert.AreEqual("abc", overallEntreyEvolyion.Name);
            Assert.AreEqual("http://myownrepo/a/abc.jpg", overallEntreyEvolyion.PictureUrl);
            Assert.AreEqual(1, overallEntreyEvolyion.CurrentOverallPosition.Rank);
            Assert.AreEqual(12, overallEntreyEvolyion.CurrentOverallPosition.Hits);
            Assert.AreEqual(1, overallEntreyEvolyion.CurrentOverallPosition.NoOfLovedTracks);
            Assert.AreEqual(44, overallEntreyEvolyion.CurrentOverallPosition.Score);
            Assert.IsNull(overallEntreyEvolyion.PreviousDayOverallPosition);
        }
Exemple #3
0
        public void MapTopItemWithPartitionKeyToOverallEntryEvolution_Evolution_Both_TopItems_Null()
        {
            var entryArtistImageProvider = new Mock <IEntryArtistImageProvider>();

            entryArtistImageProvider.Setup(m => m.GetPictureUrl("abc")).Returns("http://myownrepo/a/abc.jpg");

            var mapTopItemToOverallEntryEvolution = new MapTopItemWithPartitionKeyToOverallEntryEvolution(new MapTopItemWithPartitionKeyToPosition(), entryArtistImageProvider.Object);
            var overallEntreyEvolyion             = mapTopItemToOverallEntryEvolution.Map
                                                        (null, null);
        }