Beispiel #1
0
        public void RankingInsertDeletePostTest()
        {
            try
            {
                var rankingController = new RankingController();

                rankingController.DeleteRanking("A000009", 109);

                var ranking = rankingController.GetRankingInfo("A000009", 109);
                Assert.AreEqual(null, ranking);

                rankingController.InsertRanking(new Ranking
                {
                    StudentId  = "A000009",
                    ScheduleId = 109,
                    Rank       = 20
                });

                ranking = rankingController.GetRankingInfo("A000009", 109);
                Assert.AreEqual("A000009", ranking.StudentId);
                Assert.AreEqual(109, ranking.ScheduleId);
                Assert.AreEqual(20, ranking.Rank);

                rankingController.DeleteRanking("A000009", 109);

                ranking = rankingController.GetRankingInfo("A000009", 109);
                Assert.AreEqual(null, ranking);
            }
            catch
            {
                throw;
            }
        }