public void InvokeIPartialCircleSvgPathProvider_GetSvgPathMethodAsManyTimesAsAvailableOutputPerSecondViewModels()
        {
            // Arrange
            var outputPerSecondViewModelDataProvider = new Mock <IOutputPerSecondViewModelDataProvider>();
            var partialCircleSvgPathProvider         = new Mock <IPartialCircleSvgPathProvider>();
            var leaderboardViewModelFactory          = new Mock <ILeaderboardViewModelFactory>();

            var leaderboardService = new LeaderboardService(outputPerSecondViewModelDataProvider.Object, partialCircleSvgPathProvider.Object, leaderboardViewModelFactory.Object);

            var outputPerSecondViewModels = new List <OutputPerSecondViewModel>()
            {
                new OutputPerSecondViewModel(),
                new OutputPerSecondViewModel(),
                new OutputPerSecondViewModel(),
                new OutputPerSecondViewModel(),
                new OutputPerSecondViewModel(),
            };

            outputPerSecondViewModelDataProvider.Setup(p => p.GetTopHealingOnPageInDescendingOrder(It.IsAny <int>(), It.IsAny <int>())).Returns(outputPerSecondViewModels);

            var pageNumber = 0;

            var expectedInvocationsCount = outputPerSecondViewModels.Count;

            // Act
            leaderboardService.GetTopHealingOnPage(pageNumber);

            // Assert
            partialCircleSvgPathProvider.Verify(p => p.GetSvgPath(It.IsAny <int>(), 75, 300), Times.Exactly(expectedInvocationsCount));
        }
        public void InvokeIOutputPerSecondViewModelDataProvider_GetTopHealingOnPageInDescendingOrderAsManyTimesAsRequestedPages(int pageNumber)
        {
            // Arrange
            var outputPerSecondViewModelDataProvider = new Mock <IOutputPerSecondViewModelDataProvider>();
            var partialCircleSvgPathProvider         = new Mock <IPartialCircleSvgPathProvider>();
            var leaderboardViewModelFactory          = new Mock <ILeaderboardViewModelFactory>();

            var leaderboardService = new LeaderboardService(outputPerSecondViewModelDataProvider.Object, partialCircleSvgPathProvider.Object, leaderboardViewModelFactory.Object);

            var outputPerSecondViewModels = new List <OutputPerSecondViewModel>();

            outputPerSecondViewModelDataProvider.Setup(p => p.GetTopHealingOnPageInDescendingOrder(It.IsAny <int>(), It.IsAny <int>())).Returns(outputPerSecondViewModels);

            // Act
            leaderboardService.GetTopHealingOnPage(pageNumber);

            // Assert
            outputPerSecondViewModelDataProvider.Verify(p => p.GetTopHealingOnPageInDescendingOrder(It.IsAny <int>(), It.IsAny <int>()), Times.Exactly(pageNumber + 1));
        }
        public void InvokeILeaderboardViewModelFactory_CreateLeaderboardViewModelMethodOnce()
        {
            // Arrange
            var outputPerSecondViewModelDataProvider = new Mock <IOutputPerSecondViewModelDataProvider>();
            var partialCircleSvgPathProvider         = new Mock <IPartialCircleSvgPathProvider>();
            var leaderboardViewModelFactory          = new Mock <ILeaderboardViewModelFactory>();

            var leaderboardService = new LeaderboardService(outputPerSecondViewModelDataProvider.Object, partialCircleSvgPathProvider.Object, leaderboardViewModelFactory.Object);

            var outputPerSecondViewModels = new List <OutputPerSecondViewModel>();

            outputPerSecondViewModelDataProvider.Setup(p => p.GetTopHealingOnPageInDescendingOrder(It.IsAny <int>(), It.IsAny <int>())).Returns(outputPerSecondViewModels);

            var pageNumber = 1;

            // Act
            leaderboardService.GetTopHealingOnPage(pageNumber);

            // Assert
            leaderboardViewModelFactory.Verify(f => f.CreateLeaderboardViewModel(It.IsAny <int>(), It.IsAny <IList <OutputPerSecondViewModel> >()), Times.Once);
        }