Пример #1
0
        public void TestCompleteCurrentChallengeWhenDeadlineExpired()
        {
            string UserName = "******";
            User User = new User(UserName);
            List<Activity> requirements = new List<Activity>();
            requirements.Add(new Activity("John Doe", "Complete me", 3, 4, null));
            Challenge Challange = new Challenge("test", "do me", new Time(0, 0, 0), new Time(0, 0, 01), requirements);

            User.SetCurrentChallenge(Challange);

            User.CompleteCurrentChallenge();
        }
Пример #2
0
        public void TestCompleteCurrentChallengeWhenPossible()
        {
            string UserName = "******";
            User User = new User(UserName);
            List<Activity> requirements = new List<Activity>();
            requirements.Add(new Activity("John Doe", "Complete me", 3, 4, null));
            Challenge Challenge = new Challenge("test", "do me", new Time(0, 0, 0), new Time(23, 59, 59), requirements);

            Assert.AreEqual(false, User.CompletedChallenges.Contains(Challenge));

            User.SetCurrentChallenge(Challenge);
            User.CompleteCurrentChallenge();

            Assert.AreEqual(null, User.CurrentChallenge);
            Assert.AreEqual(true, User.CompletedChallenges.Contains(Challenge));
        }