Example #1
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);
        }
 public IActionResult Delete(string id)
 {
     LeaderBoardDBConnector.Delete(Constants.DATA_SOURCE, id);
     return Redirect("/LeaderBoard");
 }