コード例 #1
0
        public List <UserTopDTO> GetAbsoluteRanking(int absoluteNumber)
        {
            Logger.Trace("GameBusiness", "GetAbsoluteRanking", "Starting the method");
            List <UserTopDTO> result = null;

            try
            {
                var unitOfWork = Database.Context.Instance;

                var userGameRepository = new UserGameRepository(unitOfWork);

                var userGames = userGameRepository.GetAbsoluteRanking(absoluteNumber);

                result = ListUserGaMeToListUserTopDTO(userGames, 1);
            }
            catch (Exception e)
            {
                Logger.Error("GameBusiness", "GetAbsoluteRanking", e.Message);
                throw e;
            }
            finally
            {
                Logger.Trace("GameBusiness", "GetAbsoluteRanking", "Finishing method");
            }

            return(result);
        }
コード例 #2
0
        public void GetAbsoluteRanking()
        {
            var userGameRepository = new UserGameRepository(Database.Context.Instance);

            var result = userGameRepository.GetAbsoluteRanking(10);

            Assert.IsNotNull(result);

            Assert.IsNotNull(result.Count == 10);

            Assert.IsNotNull(result.First().Score >= result.Last().Score);

            result = userGameRepository.GetAbsoluteRanking(100);

            Assert.IsNotNull(result);

            Assert.IsNotNull(result.Count == 100);

            Assert.IsNotNull(result.First().Score >= result.Last().Score);
        }