public IActionResult IndexAPI()
        {
            ViewBag.Active = "LeaderBoard";

            var board = LeaderBoardDBConnector.GetLeaderBoard(Constants.DATA_SOURCE);

            return Json(board);
        }
        public IActionResult Index([FromHeader]string sendJson)
        {
            ViewBag.Active = "LeaderBoard";

            var board = LeaderBoardDBConnector.GetLeaderBoard(Constants.DATA_SOURCE);

            return sendJson != null && sendJson.Equals("True") ? Json(board) : (IActionResult)View(board);
        }
Exemplo n.º 3
0
        public void TestDelete()
        {
            LeaderBoard userRank = new LeaderBoard();

            userRank.Username = "******";
            userRank.Score    = 50;
            Assert.True(LeaderBoardDBConnector.Create(dataSource, userRank));

            List <LeaderBoard> leaderboard = LeaderBoardDBConnector.GetLeaderBoard(dataSource);

            Assert.NotNull(leaderboard);
            int count = leaderboard.Count;

            Assert.True(LeaderBoardDBConnector.Delete(dataSource, "Test Delete User"));

            leaderboard = LeaderBoardDBConnector.GetLeaderBoard(dataSource);

            Assert.NotNull(leaderboard);
            Assert.Equal(count - 1, leaderboard.Count);
        }
Exemplo n.º 4
0
        public void TestEntireLeaderBoard()
        {
            List <LeaderBoard> userScores = LeaderBoardDBConnector.GetLeaderBoard(dataSource);

            Assert.NotNull(userScores);
        }