Skip to content

Commit 0676472

Browse files
committed
Fix and simplify IgnoreChildrenElementComparerTest
1 parent 57519a0 commit 0676472

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

src/AngleSharp.Diffing.Tests/Strategies/ElementStrategies/IgnoreChildrenElementComparerTest.cs

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void Test001(string controlHtml)
2828
IgnoreChildrenElementComparer.Compare(comparison, CompareResult.Skip).ShouldBe(CompareResult.Skip);
2929
}
3030

31-
[Theory(DisplayName = "When a control element has 'diff:ignoreChildren' attribute, SameAndBreak is returned")]
31+
[Theory(DisplayName = "When a control element has 'diff:ignoreChildren' attribute, CompareResult.SkipChildren flag is returned")]
3232
[InlineData(@"<p diff:ignoreChildren></p>")]
3333
[InlineData(@"<p diff:ignoreChildren=""true""></p>")]
3434
[InlineData(@"<p diff:ignoreChildren=""TRUE""></p>")]
@@ -41,29 +41,13 @@ public void Test002(string controlHtml)
4141
IgnoreChildrenElementComparer.Compare(comparison, CompareResult.Different).ShouldBe(CompareResult.Different | CompareResult.SkipChildren);
4242
}
4343

44-
[Fact(DisplayName = "When a control element has 'diff:ignoreChildren', calling Build() with DefaultOptions() returns expected diffs")]
45-
public void Test003()
46-
{
47-
var control = @"<p attr=""foo"" missing diff:ignoreChildren>hello <em>world</em></p>";
48-
var test = @"<p attr=""bar"" unexpected>world says <strong>hello</strong></p>";
49-
50-
var diffs = DiffBuilder
51-
.Compare(control)
52-
.WithTest(test)
53-
.Build()
54-
.ToList();
55-
56-
diffs.Count.ShouldBe(3);
57-
diffs.SingleOrDefault(x => x is AttrDiff).ShouldNotBeNull();
58-
diffs.SingleOrDefault(x => x is MissingAttrDiff).ShouldNotBeNull();
59-
diffs.SingleOrDefault(x => x is UnexpectedAttrDiff).ShouldNotBeNull();
60-
}
61-
6244
[Theory(DisplayName = "When a control element has 'diff:ignoreChildren', calling Build() with DefaultOptions() returns empty diffs")]
63-
[InlineData(@"<p attr=""foo"" diff:ignoreChildren>hello <em>world</em></p>",
64-
@"<p attr=""foo"">world says <strong>hello</strong></p>")]
65-
[InlineData(@"<p attr=""foo"" expected diff:ignoreChildren>hello <em>world</em></p>",
66-
@"<p attr=""foo"" expected>world says <strong>hello</strong></p>")]
45+
[InlineData(@"<p diff:ignoreChildren>hello <em>world</em></p>",
46+
@"<p>world says <strong>hello</strong></p>")]
47+
[InlineData(@"<p diff:ignoreChildren>hello</p>",
48+
@"<p>world says <strong>hello</strong></p>")]
49+
[InlineData(@"<p diff:ignoreChildren>hello <em>world</em></p>",
50+
@"<p>world says</p>")]
6751
public void Test004(string control, string test)
6852
{
6953
var diffs = DiffBuilder

0 commit comments

Comments
 (0)