public void ParseHl2Achievements()
        {
            string xml = File.ReadAllText("hl2Achievements.xml");

            AchievementXmlParser parser = new AchievementXmlParser();

            parser.Parse(xml);
        }
        public void ParseValid()
        {
            string xml = File.ReadAllText("achievements.xml");

            AchievementXmlParser      parser       = new AchievementXmlParser();
            IEnumerable <Achievement> achievements = parser.Parse(xml, 1);

            Assert.That(achievements.Any());
        }
        public void ParseValid()
        {
            string xml = File.ReadAllText("achievements.xml");

            AchievementXmlParser      parser       = new AchievementXmlParser();
            IEnumerable <Achievement> achievements = parser.Parse(xml);

            Assert.That(achievements.Any());
            Assert.That(achievements.Any(a => a.Name == "Fried Piper" && a.Closed));
            Assert.That(achievements.Any(a => a.Name == "Cl0wnd" && !a.Closed));
        }
        public void ParseTf2MagnakayDeathFromAboveNotClosed()
        {
            string xml = File.ReadAllText("achievements2.xml");

            AchievementXmlParser      parser       = new AchievementXmlParser();
            IEnumerable <Achievement> achievements = parser.Parse(xml, 2);

            // does not contain Death from Above
            Assert.That(achievements.Any(a => a.Id == 273), Is.False);

            // does not contain First Blood
            Assert.That(achievements.Any(a => a.Id == 270), Is.False);
        }
        public void ParseNotValid()
        {
            AchievementXmlParser parser = new AchievementXmlParser();

            Assert.Throws <XmlException>(() => parser.Parse("asdf asdf asdf asdf", 1));
        }