Ejemplo n.º 1
0
 public void SetUp()
 {
     var espnFeedParser = new EspnFeedParser(new IEspnGameParser[] { new EspnFinalGameParser(), new EspnInProgressGameParser(), new EspnNotStartedGameParser() });
     _feed = espnFeedParser.Parse(inGameFeed);
     _halftimeFeed = espnFeedParser.Parse(halftimeFeed);
     _overtimeFeed = espnFeedParser.Parse(overtimeFeed);
 }
Ejemplo n.º 2
0
        public EspnFeed Parse(string rawFeed)
        {
            var feed = new EspnFeed();

            rawFeed = rawFeed.Replace("%20", " ");
            rawFeed = rawFeed.Replace("^", "");
            var rawGames = rawFeed.Split("nfl_s_left");

            for (var i = 1; i < rawGames.Length; i++)
            {
                var gameDetails = rawGames[i];
                var game = _gameParsers
                            .First(x => x.CanParse(gameDetails))
                            .ParseGame(gameDetails);

                feed.AddGame(game);
            }

            return feed;
        }
Ejemplo n.º 3
0
 public void SetUp()
 {
     var parser = new EspnFeedParser(new IEspnGameParser[] { new EspnFinalGameParser(), new EspnInProgressGameParser(), new EspnNotStartedGameParser() });
     _feed = parser.Parse(notInGameFeed);
 }