Skip to content

Commit 15cde42

Browse files
committed
- Add dotnet 9 support
- Remove FluentAssertions dependency - Update copyright year
1 parent 1c2e608 commit 15cde42

File tree

6 files changed

+36
-41
lines changed

6 files changed

+36
-41
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,10 @@ This project is supported by the [.NET Foundation](https://dotnetfoundation.org)
6161

6262
The MIT License (MIT)
6363

64-
Copyright (c) 2018 - 2023 Denis Ivanov, AngleSharp
64+
Copyright (c) 2018 - 2025 Denis Ivanov, AngleSharp
6565

6666
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6767

6868
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6969

7070
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
71-

src/AngleSharp.XPath.Tests/AngleSharp.XPath.Tests.csproj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<ItemGroup>
33
<PackageReference Include="AngleSharp.Xml" Version="1.0.0" />
4-
<PackageReference Include="FluentAssertions" Version="6.12.0" />
5-
<PackageReference Include="FluentAssertions.Analyzers" Version="0.31.0">
6-
<PrivateAssets>all</PrivateAssets>
7-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
8-
</PackageReference>
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
10-
<PackageReference Include="NUnit" Version="4.1.0" />
11-
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
4+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
5+
<PackageReference Include="NUnit" Version="4.3.2" />
6+
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
7+
<PackageReference Include="Shouldly" Version="4.3.0" />
128
</ItemGroup>
139
<ItemGroup>
1410
<ProjectReference Include="..\AngleSharp.XPath\AngleSharp.XPath.csproj" />

src/AngleSharp.XPath.Tests/HtmlDocumentNavigableTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using AngleSharp.Html.Parser;
2-
using FluentAssertions;
32
using NUnit.Framework;
43
using System;
4+
using Shouldly;
55

66
namespace AngleSharp.XPath.Tests;
77

@@ -31,6 +31,6 @@ public void CreateNavigator_Call_ShouldReturnHtmlDocumentNavigator()
3131
var navigator = navigable.CreateNavigator();
3232

3333
// Assert
34-
navigator.Should().BeOfType<HtmlDocumentNavigator>();
34+
navigator.ShouldBeOfType<HtmlDocumentNavigator>();
3535
}
3636
}

src/AngleSharp.XPath.Tests/HtmlDocumentNavigatorTests.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using AngleSharp.Dom;
22
using AngleSharp.Html.Parser;
33
using AngleSharp.Xml.Parser;
4-
using FluentAssertions;
54
using NUnit.Framework;
65
using System.Threading.Tasks;
76
using System.Xml;
87
using System.Xml.XPath;
8+
using Shouldly;
99

1010
namespace AngleSharp.XPath.Tests;
1111

@@ -24,7 +24,7 @@ public async Task SelectSingleNodeTest()
2424
var content = document.DocumentElement.SelectSingleNode("//div[@id='content']");
2525

2626
// Assert
27-
content.Should().NotBeNull();
27+
content.ShouldNotBeNull();
2828
}
2929

3030
[Test]
@@ -44,7 +44,7 @@ public void SelectNodes_SelectList_ShouldReturnList()
4444
var nodes = document.DocumentElement.SelectNodes("//li");
4545

4646
// Assert
47-
nodes.Should().HaveCount(3);
47+
nodes.Count.ShouldBe(3);
4848
}
4949

5050
[Test]
@@ -64,7 +64,7 @@ public void SelectPrecedingNodeInDocumentWithDoctype_ShouldReturnNode()
6464
var node = document.DocumentElement.SelectSingleNode("//div/preceding::span");
6565

6666
// Assert
67-
node.Should().NotBeNull();
67+
node.ShouldNotBeNull();
6868
}
6969

7070
[Test]
@@ -79,8 +79,8 @@ public void SelectSingleNode_IgnoreNamespaces_ShouldReturnNode()
7979
var node = doc.DocumentElement.SelectSingleNode("/urlset/url/link");
8080

8181
// Assert
82-
node.Should().NotBeNull();
83-
node.NodeName.Should().Be("xhtml:link");
82+
node.ShouldNotBeNull();
83+
node.NodeName.ShouldBe("xhtml:link");
8484
}
8585

8686
[Test]
@@ -99,8 +99,8 @@ public void SelectSingleNode_DontIgnoreNamespaces_ShouldReturnNode()
9999
var node = doc.DocumentElement.SelectSingleNode("/d:urlset/d:url/xhtml:link", namespaceManager, false);
100100

101101
// Assert
102-
node.Should().NotBeNull();
103-
node.NodeName.Should().Be("xhtml:link");
102+
node.ShouldNotBeNull();
103+
node.NodeName.ShouldBe("xhtml:link");
104104
}
105105

106106
[Test]
@@ -115,8 +115,8 @@ public void SelectNodes_CanReturnAttribute()
115115
var nodes = doc.DocumentElement.SelectNodes("//@*");
116116

117117
// Assert
118-
nodes.Should().HaveCount(2);
119-
nodes.Should().AllBeAssignableTo<IAttr>();
118+
nodes.Count.ShouldBe(2);
119+
nodes.ForEach(e => e.ShouldBeAssignableTo<IAttr>());
120120
}
121121

122122
[Test]
@@ -130,7 +130,7 @@ public void TestNameXPathFunctionOnXMLDoc()
130130
var xmlNav = angleSharpXmlDoc.CreateNavigator();
131131

132132
// Assert
133-
xmlNav.Evaluate("name()").Should().Be(TagNames.Html);
133+
xmlNav.Evaluate("name()").ShouldBe(TagNames.Html);
134134
}
135135

136136
[Test]
@@ -145,7 +145,7 @@ public void TestNameXPathFunctionOnHTMLDoc()
145145
var htmlNav = angleSharpHtmlDoc.CreateNavigator();
146146

147147
// Assert
148-
htmlNav.Evaluate("name()").Should().Be(TagNames.Html);
148+
htmlNav.Evaluate("name()").ShouldBe(TagNames.Html);
149149
}
150150

151151
[Test]
@@ -164,14 +164,14 @@ public void MoveToParent_CallWhenCurrentNodeIsAttr_ShouldBeMovedToAttrOwnerEleme
164164
{
165165
do
166166
{
167-
nav.NodeType.Should().Be(XPathNodeType.Attribute);
167+
nav.NodeType.ShouldBe(XPathNodeType.Attribute);
168168
}
169169
while (nav.MoveToNextAttribute());
170170
nav.MoveToParent();
171171
}
172172

173173
// Assert
174-
nav.Name.Should().Be("root");
174+
nav.Name.ShouldBe("root");
175175
}
176176

177177
[Test]
@@ -193,8 +193,8 @@ public void SelectSingleNodeTest_AttributesOrder()
193193
var div3 = document.DocumentElement.SelectSingleNode("//div[@id='div3']");
194194

195195
// Assert
196-
div1.Should().NotBeNull();
197-
div2.Should().NotBeNull();
198-
div3.Should().NotBeNull();
196+
div1.ShouldNotBeNull();
197+
div2.ShouldNotBeNull();
198+
div3.ShouldNotBeNull();
199199
}
200200
}

src/AngleSharp.XPath.Tests/XPathConfigurationTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using FluentAssertions;
21
using NUnit.Framework;
32
using System.Threading.Tasks;
3+
using Shouldly;
44

55
namespace AngleSharp.XPath.Tests;
66

@@ -15,7 +15,7 @@ public async Task RunXPathQueryFromDocumentWithSelectAll()
1515
var context = BrowsingContext.New(config);
1616
var document = await context.OpenAsync(res => res.Content(source));
1717
var elements = document.QuerySelectorAll("*[xpath>'//li']");
18-
elements.Should().HaveCount(3);
18+
elements.Length.ShouldBe(3);
1919
}
2020

2121
[Test]
@@ -26,8 +26,8 @@ public async Task RunXPathQueryFromDocumentWithSelectSingle()
2626
var context = BrowsingContext.New(config);
2727
var document = await context.OpenAsync(res => res.Content(source));
2828
var element = document.QuerySelector("*[xpath>'//li']");
29-
element.Should().NotBeNull();
30-
element.TagName.Should().Be("LI");
29+
element.ShouldNotBeNull();
30+
element.TagName.ShouldBe("LI");
3131
}
3232

3333
[Test]
@@ -38,8 +38,8 @@ public async Task RunXPathQueryFromDocumentWithSelectSingleSpecialN()
3838
var context = BrowsingContext.New(config);
3939
var document = await context.OpenAsync(res => res.Content(source));
4040
var element = document.QuerySelector("*[xpath>'//li[2]']");
41-
element.Should().NotBeNull();
42-
element.TagName.Should().Be("LI");
43-
element.ClassName.Should().Be("two");
41+
element.ShouldNotBeNull();
42+
element.TagName.ShouldBe("LI");
43+
element.ClassName.ShouldBe("two");
4444
}
4545
}

src/AngleSharp.XPath/AngleSharp.XPath.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<Version>2.0.4</Version>
4-
<AssemblyVersion>2.0.4</AssemblyVersion>
5-
<FileVersion>2.0.4</FileVersion>
3+
<Version>2.0.5</Version>
4+
<AssemblyVersion>2.0.5</AssemblyVersion>
5+
<FileVersion>2.0.5</FileVersion>
66
<Authors>Denis Ivanov</Authors>
77
<PackageId>AngleSharp.XPath</PackageId>
88
<AssemblyName>AngleSharp.XPath</AssemblyName>
99
<RootNamespace>AngleSharp.XPath</RootNamespace>
10-
<TargetFrameworks>netstandard2.0;net461;net6.0;net7.0;net8.0</TargetFrameworks>
10+
<TargetFrameworks>netstandard2.0;net461;net7.0;net8.0;net9.0</TargetFrameworks>
1111
<Description>XPath support for AngleSharp</Description>
1212
<PackageProjectUrl>https://github.com/AngleSharp/AngleSharp.XPath/</PackageProjectUrl>
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -22,7 +22,7 @@
2222
</PropertyGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="AngleSharp" Version="1.1.2" />
25+
<PackageReference Include="AngleSharp" Version="1.2.0" />
2626
</ItemGroup>
2727

2828
<ItemGroup>

0 commit comments

Comments
 (0)