This commit is contained in:
Egil Hansen 2019-12-26 07:46:21 +00:00 коммит произвёл GitHub
Родитель 844e7950e7
Коммит 4584019c8b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 5 добавлений и 26 удалений

Просмотреть файл

@ -14,32 +14,11 @@ AngleSharp Diffing makes it possible to compare AngleSharp _control_ nodes and _
The _control_ nodes represents the expected HTML tree, i.e. how the nodes are expected to look, and the _test_ nodes represents the nodes that should be compared to the _control_ nodes.
See the [Wiki for documentation](https://github.com/AngleSharp/AngleSharp.Diffing/wiki) and more examples.
**Differences:** There are three types off `IDiff` differences, that the library can return.
- `NodeDiff`/`AttrDiff`: Represents a difference between a control and test node or a control and test attribute.
- `MissingNodeDiff`/`MissingAttrDiff`: Represents a difference where a control node or control attribute was expected to exist, but was not found in the test nodes tree.
- `UnexpectedNodeDiff`/`UnexpectedAttrDiff`: Represents a difference where a test node or test attribute was unexpectedly found in the test nodes tree, but did not have a match in the control nodes tree.
# Usage
To find the differences between a control HTML fragment and a test HTML fragment, using the default options, the easiest way is to use the `DiffBuilder` class, like so:
```csharp
var controlHtml = "<p>Hello World</p>";
var testHtml = "<p>World, I say hello</p>";
var diffs = DiffBuilder
.Compare(control)
.WithTest(test)
.Build();
```
Read more about the available options on the [Options](/docs/Options.md) page.
# Documentation
- [Options](/docs/Options.md)
- [Creating custom diffing options](/docs/CustomOptions.md)
- [Difference engine internals](/docs/DiffingEngineInternals.md)
### Documentation:
- [Getting started](https://github.com/AngleSharp/AngleSharp.Diffing/wiki/Getting-Started)
- [Diffing options](https://github.com/AngleSharp/AngleSharp.Diffing/wiki/Diffing-Options)
- [Creating custom diffing strategies](https://github.com/AngleSharp/AngleSharp.Diffing/wiki/Getting-Started)
- [Difference Engine Internals](https://github.com/AngleSharp/AngleSharp.Diffing/wiki/Difference-Engine-Internals)
## Acknowledgments
- [Florian Rappl](https://github.com/FlorianRappl) from the AngleSharp team for providing ideas, input and sample code for working with AngleSharp.