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

TestContestLockContest() private method

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

                Log("Creating contest");
                Contest contest = new Contest()
                {
                    Name = "Test Contest1",
                    Description = "This is a test contest",
                    Reward = 30,
                    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);

                ContestManager.AddGroup(id, _group1);
                ContestManager.AddGroup(id, _group2);

                Log("Locking Initialization");
                ContestManager.LockContest(id);

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

                Log("Verifying that contest participants have been locked");
                Assert.IsTrue(retrieved.Teams[0].Members[0].Initialized);
                Assert.IsTrue(retrieved.Teams[0].Members[1].Initialized);
                Assert.IsTrue(retrieved.Teams[1].Members[0].Initialized);
                Assert.IsTrue(retrieved.Teams[1].Members[1].Initialized);
            }
        }