public void boardGameURL_SingleGameNullSettings_ReturnsUrl()
        {
            // Arrange
            IUrlBuilder testBuilder = new UrlBuilder();
            string expected = "http://www.boardgamegeek.com/xmlapi/boardgame/12345";

            // Act
            string result = testBuilder.buildBoardGameUrl(null, 12345);

            // Assert
            Assert.AreEqual(expected, result);
        }
        public void boardGameURL_WithCurrentStatsSettings_ReturnsUrl()
        {
            // Arrange
            IUrlBuilder testBuilder = new UrlBuilder();
            BoardGameSettings settings = new BoardGameSettings()
            {
                commSets = commentSettings.none,
                statSets = statsSettings.current
            };

            string expected = "http://www.boardgamegeek.com/xmlapi/boardgame/12345?comments=0&stats=1";

            // Act
            string result = testBuilder.buildBoardGameUrl(settings, 12345);

            // Assert
            Assert.AreEqual(expected, result);
        }
        public void boardGameURL_WithHistoricStatsAndFromDate_ReturnsUrl()
        {
            // Arrange
            IUrlBuilder testBuilder = new UrlBuilder();
            BoardGameSettings settings = new BoardGameSettings()
            {
                commSets = commentSettings.none,
                statSets = statsSettings.histroic,
                historicStatsFrom = new DateTime(2011, 01, 02)
            };

            string toDate = DateTime.Now.ToString("yyyy-MM-dd");

            string expected = "http://www.boardgamegeek.com/xmlapi/boardgame/12345?comments=0&historical=1&from=2011-01-02&to=" + toDate;

            // Act
            string result = testBuilder.buildBoardGameUrl(settings, 12345);

            // Assert
            Assert.AreEqual(expected, result);
        }
        public void userCollectionURL_WishList_ReturnsUrl()
        {
            // Arrange
            IUrlBuilder testBuilder = new UrlBuilder();
            CollectionSettings set = new CollectionSettings()
            {
                collectionFilter = userCollection.wishlist
            };

            string expected = "http://www.boardgamegeek.com/xmlapi/collection/Rokusho?wishlist=1";

            // Act
            string result = testBuilder.buildUserCollectionUrl(set, "Rokusho");

            // Assert
            Assert.AreEqual(expected, result);
        }
        public void userCollectionURL_MinBGGRating_ReturnsUrl()
        {
            // Arrange
            IUrlBuilder testBuilder = new UrlBuilder();
            CollectionSettings set = new CollectionSettings()
            {
                collectionFilter = userCollection.all,
                minBGGRating = 3
            };

            string expected = "http://www.boardgamegeek.com/xmlapi/collection/Rokusho?minbggrating=3";

            // Act
            string result = testBuilder.buildUserCollectionUrl(set, "Rokusho");

            // Assert
            Assert.AreEqual(expected, result);
        }
        public void userCollectionURL_DefaultSetting_ReturnsUrl()
        {
            // Arrange
            IUrlBuilder testBuilder = new UrlBuilder();

            string expected = "http://www.boardgamegeek.com/xmlapi/collection/Rokusho";

            // Act
            string result = testBuilder.buildUserCollectionUrl(null, "Rokusho");

            // Assert
            Assert.AreEqual(expected, result);
        }
        public void userCollectionURL_7Settings_ReturnsUrl()
        {
            // Arrange
            IUrlBuilder testBuilder = new UrlBuilder();
            CollectionSettings set = new CollectionSettings()
            {
                collectionFilter = userCollection.own,
                minPlays = 12,
                maxPlays = 98,
                minBGGRating = 3,
                maxBGGRating = 9,
                minRating = 2,
                maxRating = 10
            };

            string expected = "http://www.boardgamegeek.com/xmlapi/collection/Rokusho?own=1&maxbggrating=9&maxplays=98&maxrating=10&minbggrating=3&minplays=12&minrating=2";

            // Act
            string result = testBuilder.buildUserCollectionUrl(set, "Rokusho");

            // Assert
            Assert.AreEqual(expected, result);
        }
        public void userCollectionURL_2Settings_ReturnsUrl()
        {
            // Arrange
            IUrlBuilder testBuilder = new UrlBuilder();
            CollectionSettings set = new CollectionSettings()
            {
                collectionFilter = userCollection.own,
                minPlays = 12
            };

            string expected = "http://www.boardgamegeek.com/xmlapi/collection/Rokusho?own=1&minplays=12";

            // Act
            string result = testBuilder.buildUserCollectionUrl(set, "Rokusho");

            // Assert
            Assert.AreEqual(expected, result);
        }
        public void searchURL_ExactSettings_ReturnsUrl()
        {
            // Arrange
            IUrlBuilder testBuilder = new UrlBuilder();
            string expected = "http://www.boardgamegeek.com/xmlapi/search?search=7 Wonders&exact=1";

            // Act
            string result = testBuilder.buildSearchUrl(SearchSettings.exact, "7 Wonders");

            // Assert
            Assert.AreEqual(expected, result);
        }
        public void geekListURL_WithCommentSettings_ReturnsUrl()
        {
            // Arrange
            IUrlBuilder testBuilder = new UrlBuilder();
            string expected = "http://www.boardgamegeek.com/xmlapi/geeklist/12345?comments=1";

            // Act
            string result = testBuilder.buildGeekListUrl(commentSettings.fetch, 12345);

            // Assert
            Assert.AreEqual(expected, result);
        }
        public void boardGameURL_WithHistoricStatsSettings_ReturnsUrl()
        {
            // Arrange
            IUrlBuilder testBuilder = new UrlBuilder();
            BoardGameSettings settings = new BoardGameSettings()
            {
                commSets = commentSettings.none,
                statSets = statsSettings.histroic,
                historicStatsFrom = new DateTime(2012, 01, 21),
                historicStatsTo = new DateTime(2013, 02, 26)
            };

            string expected = "http://www.boardgamegeek.com/xmlapi/boardgame/12345?comments=0&historical=1&from=2012-01-21&to=2013-02-26";

            // Act
            string result = testBuilder.buildBoardGameUrl(settings, 12345);

            // Assert
            Assert.AreEqual(expected, result);
        }