コード例 #1
0
ファイル: When_Scrap_Nova.cs プロジェクト: dublow/MskManager
        public void When_scrap_async_with_null_message_return_error()
        {
            var httpClient = HttpClientBuilder
                             .Create()
                             .WithGetAsync(uri, null)
                             .Build();

            var scrapper = new RadioScrapper(httpClient);

            var actual = Assert.Throws <ParsorException>(() => scrapper.Scrap(uri, new NovaParser()));

            Assert.AreEqual("Nova", actual.Message);
        }
コード例 #2
0
        public void When_scrap_with_valid_message_return_success()
        {
            var message = FileLoader.Get(fileName);

            var httpClient = HttpClientBuilder
                             .Create()
                             .WithGet(uri, message)
                             .Build();

            var scrapper = new RadioScrapper(httpClient);

            var actual = scrapper.Scrap(uri, new FipParser());

            Assert.AreEqual("VINICIO CAPOSSELA", actual.Artist);
            Assert.AreEqual("L ACQUA CHIARA ALLA FONTANA", actual.Title);
        }
コード例 #3
0
ファイル: When_Scrap_Nova.cs プロジェクト: dublow/MskManager
        public void When_scrap_with_valid_message_return_success()
        {
            var message = FileLoader.Get(fileName);

            var httpClient = HttpClientBuilder
                             .Create()
                             .WithGet(uri, message)
                             .Build();

            var scrapper = new RadioScrapper(httpClient);

            var actual = scrapper.Scrap(uri, new NovaParser());

            Assert.AreEqual("FUTURO PELO", actual.Artist);
            Assert.AreEqual("SWAMP", actual.Title);
        }
コード例 #4
0
ファイル: When_Scrap_Djam.cs プロジェクト: dublow/MskManager
        public void When_scrap_with_valid_message_return_success()
        {
            var message = FileLoader.Get(fileName);

            var httpClient = HttpClientBuilder
                             .Create()
                             .WithGet(uri, message)
                             .Build();

            var scrapper = new RadioScrapper(httpClient);

            var actual = scrapper.Scrap(uri, new DjamParser());

            Assert.AreEqual("Willie Wright", actual.Artist);
            Assert.AreEqual("Love Is Expensive", actual.Title);
        }