ActivEarth.Tests.Competition.ContestTest.TestRemoveContestFromContestId C# (CSharp) Method

TestRemoveContestFromContestId() private method

private TestRemoveContestFromContestId ( ) : void
return void
        public void TestRemoveContestFromContestId()
        {
            using (_trans)
            {
                InitializeTestDBEntries();

                Log("Creating contest");
                Contest contest = new Contest()
                {
                    Name = "Test Contest1",
                    Description = "This is a test contest",
                    Mode = ContestEndMode.GoalBased,
                    Type = ContestType.Group,
                    StartTime = DateTime.Today,
                    EndValue = 500,
                    IsActive = true,
                    IsSearchable = true,
                    StatisticBinding = Statistic.Steps,
                    CreatorId = _user1.UserID
                };

                Log("Saving to DB");
                int id = ContestDAO.CreateNewContest(contest);

                Log("Reading back from DB");
                Contest retrieved = ContestDAO.GetContestFromContestId(id, false, false);

                Log("Verifying that the contest was retrieved");
                Assert.IsNotNull(retrieved);

                Log("Removing contest from db");
                Assert.IsTrue(ContestDAO.RemoveContestFromContestId(id));

                Log("Attempting to read contest back from DB");
                Contest retrieved2 = ContestDAO.GetContestFromContestId(id, false, false);

                Log("Verifying that the contest was not found");
                Assert.IsNull(retrieved2);
            }
        }