public void MapTopItemToDayEntryEvolution_UnMatched_OnSame_Level() { var entryArtistImageProvider = new Mock <IEntryArtistImageProvider>(); entryArtistImageProvider.Setup(m => m.GetPictureUrl("abc")).Returns("http://myownrepo/a/abc.jpg"); entryArtistImageProvider.Setup(m => m.GetPictureUrl("abcd")).Returns("http://myownrepo/a/abcd.jpg"); var mapTopItemToDayEntryEvolution = new MapTopItemToDayEntryEvolution(new MapTopItemToPositions(), entryArtistImageProvider.Object); var dayEntryEvolution = mapTopItemToDayEntryEvolution.Map( new TopItem { Name = "abc", DayRanking = 1, Hits = 14, Loved = 1, Score = 70, OverallDayRanking = 25, OverallHits = 140, OverallLoved = 3, OverallScore = 700 }, new TopItem { Name = "abcd", DayRanking = 2, Hits = 10, Loved = 0, Score = 44, OverallDayRanking = 35, OverallHits = 130, OverallLoved = 2, OverallScore = 680 }); }
public void MapTopItemToDayEntryEvolution_ReEntry() { var entryArtistImageProvider = new Mock <IEntryArtistImageProvider>(); entryArtistImageProvider.Setup(m => m.GetPictureUrl("abc")).Returns("http://myownrepo/a/abc.jpg"); entryArtistImageProvider.Setup(m => m.GetPictureUrl("abcd")).Returns("http://myownrepo/a/abcd.jpg"); var mapTopItemToDayEntryEvolution = new MapTopItemToDayEntryEvolution(new MapTopItemToPositions(), entryArtistImageProvider.Object); var dayEntryEvolution = mapTopItemToDayEntryEvolution.Map( new TopItem { Name = "abc", DayRanking = 1, Hits = 14, Loved = 1, Score = 70, OverallDayRanking = 25, OverallHits = 140, OverallLoved = 3, OverallScore = 700 }, new TopItem { Name = "abc", DayRanking = 0, Hits = 0, Loved = 0, Score = 0, OverallDayRanking = 35, OverallHits = 130, OverallLoved = 2, OverallScore = 680 }); Assert.AreEqual("abc", dayEntryEvolution.Name); Assert.AreEqual("http://myownrepo/a/abc.jpg", dayEntryEvolution.PictureUrl); Assert.AreEqual(1, dayEntryEvolution.CurrentDayPosition.Rank); Assert.AreEqual(14, dayEntryEvolution.CurrentDayPosition.Hits); Assert.AreEqual(1, dayEntryEvolution.CurrentDayPosition.NoOfLovedTracks); Assert.AreEqual(70, dayEntryEvolution.CurrentDayPosition.Score); Assert.IsNotNull(dayEntryEvolution.PreviousDayPosition); Assert.AreEqual(0, dayEntryEvolution.PreviousDayPosition.Hits); Assert.AreEqual(0, dayEntryEvolution.PreviousDayPosition.NoOfLovedTracks); Assert.AreEqual(0, dayEntryEvolution.PreviousDayPosition.Score); Assert.AreEqual(9999, dayEntryEvolution.PreviousDayPosition.Rank); Assert.AreEqual(25, dayEntryEvolution.CurrentOverallPosition.Rank); Assert.AreEqual(140, dayEntryEvolution.CurrentOverallPosition.Hits); Assert.AreEqual(3, dayEntryEvolution.CurrentOverallPosition.NoOfLovedTracks); Assert.AreEqual(700, dayEntryEvolution.CurrentOverallPosition.Score); Assert.AreEqual(35, dayEntryEvolution.PreviousDayOverallPosition.Rank); Assert.AreEqual(130, dayEntryEvolution.PreviousDayOverallPosition.Hits); Assert.AreEqual(2, dayEntryEvolution.PreviousDayOverallPosition.NoOfLovedTracks); Assert.AreEqual(680, dayEntryEvolution.PreviousDayOverallPosition.Score); }