|
1 |
| -Steps in finding differences: |
| 1 | +# AngleSharp.Diffing |
| 2 | +This library makes it possible to compare a AngleSharp _control_ `INodeList` and a _test_ `INodeList` and get a list of differences between them. |
2 | 3 |
|
3 |
| -``` |
4 |
| -var diffs : [] |
5 |
| -var currentPath : string |
6 |
| -var controlNodes : [] |
7 |
| -var testNodes : [] |
8 |
| -foreach (ctrlNode, index) in controlNodes |
9 |
| - if(shouldSkip(ctrlNode)) continue; |
| 4 | +The _control_ nodes represents the expected, i.e. how the nodes are expected to look, and the _test_ nodes represents the other nodes |
| 5 | +that should be compared to the _control_ nodes. |
10 | 6 |
|
11 |
| - ctrlSource = {ctrlNode, index, currentPath} |
12 |
| - testNode = nodeMatcher(ctrlSource) |
| 7 | +## Usage |
13 | 8 |
|
14 |
| -
|
15 |
| - testSource = |
16 |
| -
|
17 |
| -
|
18 |
| -nodeMatcher() -> |
19 |
| -``` |
20 |
| - |
21 |
| - |
22 |
| - |
23 |
| -- NodeFilter - filters away nodes that should not be part of the comparison |
24 |
| - - Inline filter(ignorer) |
25 |
| -- NodeMatcher - matches a control-node with a test-node for comparison |
26 |
| -- Compare nodes by: |
27 |
| - - AttributeFilter - filters away attributes not compared |
28 |
| - - Inline filter(ignorer) |
29 |
| - - AttributeMatcher - matches control-attr with test-attr for comparison |
30 |
| - - Inline matcher(css selector) |
31 |
| - - For each attribute-compare set: |
32 |
| - - apply attribute compare function |
33 |
| - - apply inline-attribute-compare function |
34 |
| - - For each child-node - compare recursively between control and test child-nodes |
| 9 | +## Difference engine steps |
| 10 | +The heart of the library is the `HtmlDifferenceEngine`, which goes through the following steps to determine if the |
| 11 | +control `INodeList` is the same as the test `INodeList`. |
0 commit comments