예제 #1
0
        public void ReadsLiveData()
        {
            HunterService service = new HunterService();
            var result = service.GetCardsForSet("Avacyn Restored");

            Assert.IsNotNull(result);
            Assert.AreEqual(234, result.Count());
        }
예제 #2
0
        public IEnumerable<Card> Get(string subtype)
        {
            var innistradBlockSets = new[]
            {
                "Innistrad",
                "Dark Ascension",
                "Avacyn Restored",
            };

            var hunter = new HunterService();

            return innistradBlockSets
                .AsParallel()
                .SelectMany(setName => hunter.GetCardsForSet(setName))
                .Where(c => c.compactType != null)
                .Where(c => ((string)c.compactType).ToLower().Contains((subtype ?? String.Empty).ToLower()))
                .Select(c => new Card((string)c.checklistName, (string)c.checklistColor));
        }