示例#1
0
        public void CompositeAchievement_StartsIncomplete()
        {
            var objective   = new StatMAchievementTest(1);
            var achievement = new MCompositeAchievement("", objective);

            Assert.IsFalse(achievement.IsCompleted);
        }
示例#2
0
        public void StatAchievement_PartCompleted()
        {
            var achievement = new StatMAchievementTest(2);

            MEvents.RaiseEvent(new TestEvent(1));

            Assert.IsTrue(Math.Abs(achievement.Progress - 0.5f) < 0.0001f);
        }
示例#3
0
        public void StatAchievement_NotCompleted()
        {
            var achievement = new StatMAchievementTest(2);

            MEvents.RaiseEvent(new TestEvent(1));

            Assert.IsFalse(achievement.IsCompleted);
        }
示例#4
0
        public void StatAchievement_CompleteCorrect()
        {
            var achievement = new StatMAchievementTest(1);

            MEvents.RaiseEvent(new TestEvent(1));

            Assert.IsTrue(achievement.IsCompleted);
        }
示例#5
0
        public void CompositeAchievement_CompletesFor1Objective()
        {
            var objective   = new StatMAchievementTest(1);
            var achievement = new MCompositeAchievement("", objective);

            MEvents.RaiseEvent(new TestEvent(1));

            Assert.IsTrue(achievement.IsCompleted);
        }
示例#6
0
        public void CompositeAchievement_PartialCompletion()
        {
            var objective1 = new StatMAchievementTest(1);
            var objective2 = new StatMAchievementTest(2);

            var achievement = new MCompositeAchievement("", objective1, objective2);

            MEvents.RaiseEvent(new TestEvent(1));

            Assert.IsTrue(Math.Abs(achievement.Progress - 0.5f) < 0.0001f);
        }
示例#7
0
        public void CompositeAchievement_NestedCompletion()
        {
            var objective1 = new StatMAchievementTest(1);
            var objective2 = new StatMAchievementTest(2);
            var objective3 = new MCompositeAchievement("", objective1, objective2);
            var objective4 = new StatMAchievementTest(3);

            var achievement = new MCompositeAchievement("", objective3, objective4);

            MEvents.RaiseEvent(new TestEvent(3));

            Assert.IsTrue(achievement.IsCompleted);
        }
示例#8
0
        public void StatAchievement_StartsIncomplete()
        {
            var achievement = new StatMAchievementTest(1);

            Assert.IsFalse(achievement.IsCompleted);
        }
示例#9
0
        public void CompositeAchievement_DuplicateObjectives()
        {
            var objective = new StatMAchievementTest(1);

            Assert.Throws <ArgumentException>(() => { new MCompositeAchievement("", objective, objective); });
        }