public async Task ShouldReturnFileWhenFound() { var assemblyPath = An.AssemblyPath(); var path = Path.Combine(assemblyPath, "altbau-wohnungen.html"); var result = await HtmlDocumentFactory.FromFileAsync(path); Assert.Multiple(() => { Assert.That(result, Is.Not.Null, "was null"); Assert.That(result.DocumentNode.InnerHtml.GetHashCode(), Is.EqualTo(1207631242), "hash code"); }); }
public void ShouldThrowFileNotFoundExceptionWhenPathIsInvalid() { Assert.That(async() => await HtmlDocumentFactory.FromFileAsync("foobar.dat"), Throws.InstanceOf <FileNotFoundException>()); }
public void ShouldThrowArgumentNullExceptionWhenPathIsNull() { Assert.That(() => HtmlDocumentFactory.FromFileAsync(null), Throws.ArgumentNullException); }