1- using System ;
1+ using System ;
22using System . Linq ;
33using AngleSharp . Diffing . Core ;
4+ using AngleSharp . Dom ;
45using Shouldly ;
56using Xunit ;
67
78namespace AngleSharp . Diffing . Strategies
89{
910 public class DiffingStrategyPipelineTest : DiffingTestBase
1011 {
11- private readonly DiffContext _dummyContext = new DiffContext ( null , null ) ;
12-
1312 public DiffingStrategyPipelineTest ( DiffingTestFixture fixture ) : base ( fixture )
1413 {
1514 }
@@ -100,7 +99,7 @@ public void Test61()
10099 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new Comparison ( s [ 0 ] , t [ 0 ] ) } , isSpecializedMatcher : true ) ;
101100 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new Comparison ( s [ 1 ] , t [ 1 ] ) } , isSpecializedMatcher : true ) ;
102101
103- var result = sut . Match ( _dummyContext , sourceColllection , sourceColllection ) . ToList ( ) ;
102+ var result = sut . Match ( DummyContext , sourceColllection , sourceColllection ) . ToList ( ) ;
104103
105104 result [ 0 ] . Control . ShouldBe ( sourceColllection [ 1 ] ) ;
106105 result [ 1 ] . Control . ShouldBe ( sourceColllection [ 0 ] ) ;
@@ -114,7 +113,7 @@ public void Test71()
114113 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new AttributeComparison ( s [ "foo" ] , t [ "foo" ] ) } , isSpecializedMatcher : true ) ;
115114 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new AttributeComparison ( s [ "baz" ] , t [ "baz" ] ) } , isSpecializedMatcher : true ) ;
116115
117- var result = sut . Match ( _dummyContext , sourceMap , sourceMap ) . ToList ( ) ;
116+ var result = sut . Match ( DummyContext , sourceMap , sourceMap ) . ToList ( ) ;
118117
119118 result [ 0 ] . Control . ShouldBe ( sourceMap [ "baz" ] ) ;
120119 result [ 1 ] . Control . ShouldBe ( sourceMap [ "foo" ] ) ;
@@ -128,7 +127,7 @@ public void Test62()
128127 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new Comparison ( s [ 0 ] , t [ 0 ] ) } , isSpecializedMatcher : false ) ;
129128 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new Comparison ( s [ 1 ] , t [ 1 ] ) } , isSpecializedMatcher : false ) ;
130129
131- var result = sut . Match ( _dummyContext , sourceColllection , sourceColllection ) . ToList ( ) ;
130+ var result = sut . Match ( DummyContext , sourceColllection , sourceColllection ) . ToList ( ) ;
132131
133132 result [ 0 ] . Control . ShouldBe ( sourceColllection [ 0 ] ) ;
134133 result [ 1 ] . Control . ShouldBe ( sourceColllection [ 1 ] ) ;
@@ -142,7 +141,7 @@ public void Test72()
142141 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new AttributeComparison ( s [ "foo" ] , t [ "foo" ] ) } , isSpecializedMatcher : false ) ;
143142 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new AttributeComparison ( s [ "baz" ] , t [ "baz" ] ) } , isSpecializedMatcher : false ) ;
144143
145- var result = sut . Match ( _dummyContext , sourceMap , sourceMap ) . ToList ( ) ;
144+ var result = sut . Match ( DummyContext , sourceMap , sourceMap ) . ToList ( ) ;
146145
147146 result [ 0 ] . Control . ShouldBe ( sourceMap [ "foo" ] ) ;
148147 result [ 1 ] . Control . ShouldBe ( sourceMap [ "baz" ] ) ;
@@ -156,7 +155,7 @@ public void Test62123()
156155 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new Comparison ( s [ 0 ] , t [ 0 ] ) } , isSpecializedMatcher : false ) ;
157156 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new Comparison ( s [ 1 ] , t [ 1 ] ) } , isSpecializedMatcher : true ) ;
158157
159- var result = sut . Match ( _dummyContext , sourceColllection , sourceColllection ) . ToList ( ) ;
158+ var result = sut . Match ( DummyContext , sourceColllection , sourceColllection ) . ToList ( ) ;
160159
161160 result [ 0 ] . Control . ShouldBe ( sourceColllection [ 1 ] ) ;
162161 result [ 1 ] . Control . ShouldBe ( sourceColllection [ 0 ] ) ;
@@ -170,7 +169,7 @@ public void Test74342()
170169 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new AttributeComparison ( s [ "foo" ] , t [ "foo" ] ) } , isSpecializedMatcher : false ) ;
171170 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new AttributeComparison ( s [ "baz" ] , t [ "baz" ] ) } , isSpecializedMatcher : true ) ;
172171
173- var result = sut . Match ( _dummyContext , sourceMap , sourceMap ) . ToList ( ) ;
172+ var result = sut . Match ( DummyContext , sourceMap , sourceMap ) . ToList ( ) ;
174173
175174 result [ 0 ] . Control . ShouldBe ( sourceMap [ "baz" ] ) ;
176175 result [ 1 ] . Control . ShouldBe ( sourceMap [ "foo" ] ) ;
@@ -237,13 +236,12 @@ public void Test8314(CompareResult first, CompareResult final)
237236 [ Fact ( DisplayName = "After two nodes has been matched, they are marked as matched in the source collection" ) ]
238237 public void Test101 ( )
239238 {
240- var context = new DiffContext ( null , null ) ;
241239 var controlSources = ToSourceCollection ( "<p></p>" , ComparisonSourceType . Control ) ;
242240 var testSources = ToSourceCollection ( "<p></p>" , ComparisonSourceType . Test ) ;
243241 var sut = new DiffingStrategyPipeline ( ) ;
244242 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new Comparison ( s [ 0 ] , t [ 0 ] ) } , isSpecializedMatcher : true ) ;
245243
246- var result = sut . Match ( context , controlSources , testSources ) . ToList ( ) ;
244+ var result = sut . Match ( DummyContext , controlSources , testSources ) . ToList ( ) ;
247245
248246 controlSources . GetUnmatched ( ) . ShouldBeEmpty ( ) ;
249247 testSources . GetUnmatched ( ) . ShouldBeEmpty ( ) ;
@@ -252,13 +250,12 @@ public void Test101()
252250 [ Fact ( DisplayName = "After two attributes has been matched, they are marked as matched in the source map" ) ]
253251 public void Test102 ( )
254252 {
255- var context = new DiffContext ( null , null ) ;
256253 var controlSources = ToSourceMap ( @"<p foo=""bar""></p>" , ComparisonSourceType . Control ) ;
257254 var testSources = ToSourceMap ( @"<p foo=""bar""></p>" , ComparisonSourceType . Test ) ;
258255 var sut = new DiffingStrategyPipeline ( ) ;
259256 sut . AddMatcher ( ( ctx , s , t ) => new [ ] { new AttributeComparison ( s [ "foo" ] , t [ "foo" ] ) } , isSpecializedMatcher : true ) ;
260257
261- var result = sut . Match ( context , controlSources , testSources ) . ToList ( ) ;
258+ var result = sut . Match ( DummyContext , controlSources , testSources ) . ToList ( ) ;
262259
263260 controlSources . GetUnmatched ( ) . ShouldBeEmpty ( ) ;
264261 testSources . GetUnmatched ( ) . ShouldBeEmpty ( ) ;
0 commit comments