public void boardGameParse_SingleGameAllData_Age()
        {
            // Arrange
            XDocument testData = XDocument.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, testDataRelativePath));

            IXMLParser parser = new XMLParser();

            // Act
            var result = parser.parseBoardGameXML(testData);

            // Assert
            Assert.AreEqual(14, result.First(x => x.ObjectID == 124742).age);
        }
        public void boardGameParse_SingleGameAllData_ImageURL()
        {
            // Arrange
            XDocument testData = XDocument.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, testDataRelativePath));

            IXMLParser parser = new XMLParser();

            string expected = "http://cf.geekdo-images.com/images/pic1324609.jpg";

            // Act
            var result = parser.parseBoardGameXML(testData);

            // Assert
            Assert.AreEqual(expected, result.First(x => x.ObjectID == 124742).imageURL);
        }
        public void boardGameParse_SingleGameAllData_Description()
        {
            // Arrange
            XDocument testData = XDocument.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, testDataRelativePath));

            IXMLParser parser = new XMLParser();

            string expected = "A shorter simpler description that is testable.  Duh.";

            // Act
            var result = parser.parseBoardGameXML(testData);

            // Assert
            Assert.AreEqual(expected, result.First(x => x.ObjectID == 124742).description);
        }
        public void boardGameParse_SingleGameAllData_Stats_Wanting()
        {
            // Arrange
            XDocument testData = XDocument.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, testDataRelativePath));

            IXMLParser parser = new XMLParser();

            // Act
            var result = parser.parseBoardGameXML(testData);

            // Assert
            Assert.AreEqual(185, result.First(x => x.ObjectID == 124742)
                                        .statistics.First(x => x.statDate == new DateTime(2012, 08, 12))
                                        .wanting);
        }
        public void boardGameParse_SingleGameAllData_Stats_StandardDeviation()
        {
            // Arrange
            XDocument testData = XDocument.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, testDataRelativePath));

            IXMLParser parser = new XMLParser();

            // Act
            var result = parser.parseBoardGameXML(testData);

            // Assert - Note the delta set to 5% to compensate for floats
            Assert.AreEqual(2.05223, result.First(x => x.ObjectID == 124742)
                                        .statistics.First(x => x.statDate == new DateTime(2012, 08, 12))
                                        .standardDeviation, 0.05);
        }
        public void boardGameParse_SingleGameAllData_Stats_Ranks_BayesAverage()
        {
            // Arrange
            XDocument testData = XDocument.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, testDataRelativePath));

            IXMLParser parser = new XMLParser();

            // Act
            var result = parser.parseBoardGameXML(testData);

            // Assert to within a 5% confidence interval
            Assert.AreEqual(3.2550, result.First(x => x.ObjectID == 124742)
                                        .statistics.First(x => x.statDate == new DateTime(2012, 08, 12))
                                        .ranks.First(x => x.id == 1)
                                        .bayesAverage, 0.05);
        }
        public void boardGameParse_SingleGameAllData_Polls_TotalVotes()
        {
            // Arrange
            XDocument testData = XDocument.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, testDataRelativePath));

            IXMLParser parser = new XMLParser();

            // Act
            var result = parser.parseBoardGameXML(testData);

            // Assert
            Assert.AreEqual(90, result.First(x => x.ObjectID == 124742).polls.First(x => x.pollName == "language_dependence").totalVotes);
        }
        public void boardGameParse_SingleGameAllData_Polls_Response_Value()
        {
            // Arrange
            XDocument testData = XDocument.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, testDataRelativePath));

            IXMLParser parser = new XMLParser();

            // Act
            var result = parser.parseBoardGameXML(testData);

            // Assert
            Assert.AreEqual("No necessary in-game text", result.First(x => x.ObjectID == 124742)
                                    .polls.First(x => x.pollName == "language_dependence")
                                    .resultsList.First(x => x.level == 1).responseValue);
        }
        public void boardGameParse_SingleGameAllData_Names_SortIndex()
        {
            // Arrange
            XDocument testData = XDocument.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, testDataRelativePath));

            IXMLParser parser = new XMLParser();

            // Act
            var result = parser.parseBoardGameXML(testData);

            // Assert
            Assert.AreEqual(1, result.First(x => x.ObjectID == 124742).names.First(x => x.name == "Android: Netrunner").sortIndex);
        }
        public void boardGameParse_SingleGameAllData_Comments_Rating()
        {
            // Arrange
            XDocument testData = XDocument.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, testDataRelativePath));

            IXMLParser parser = new XMLParser();

            // Act
            var result = parser.parseBoardGameXML(testData);

            // Assert
            Assert.AreEqual(7, result.First(x => x.ObjectID == 124742).comments.First(x => x.username == "A Strange Aeon").rating);
        }
        public void boardGameParse_SingleGameAllData_Comments_Comment()
        {
            // Arrange
            XDocument testData = XDocument.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, testDataRelativePath));

            IXMLParser parser = new XMLParser();
            string expected = "Sounds really fun--I never got to play the original Netrunner (too busy with Magic at the time), but the theme and asymmetry sound really cool. ";

            // Act
            var result = parser.parseBoardGameXML(testData);

            // Assert
            Assert.AreEqual(expected, result.First(x => x.ObjectID == 124742).comments.First(x => x.username == "A Strange Aeon").comment);
        }
        public void boardGameParse_SingleGameAllData_Honors_Value()
        {
            // Arrange
            XDocument testData = XDocument.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, testDataRelativePath));

            IXMLParser parser = new XMLParser();

            string expected = "2012 Golden Geek Best 2-Player Board Game Nominee";

            // Act
            var result = parser.parseBoardGameXML(testData);

            // Assert
            Assert.AreEqual(expected, result.First(x => x.ObjectID == 124742).honors.First(x => x.objectID == 20116).value);
        }