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); }
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); }
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); }
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); }