Skip to content

Commit

Permalink
Adapt test runner to NUnit's v4 spec
Browse files Browse the repository at this point in the history
  • Loading branch information
rdipardo committed Dec 5, 2023
1 parent 139543d commit 8e045e2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"fsdocs-tool": {
"version": "16.1.1",
"version": "19.1.1",
"commands": [
"fsdocs"
]
Expand All @@ -21,7 +21,7 @@
]
},
"paket": {
"version": "7.2.1",
"version": "8.0.0",
"commands": [
"paket"
]
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
**.props text eol=crlf
**.cmd text eol=crlf
**.bat text eol=crlf
*.json text eol=lf
scripts/changelog text eol=lf
build text eol=lf
example/** linguist-documentation
Expand Down
2 changes: 1 addition & 1 deletion example/Fornax.Seo.Example/Fornax.Seo.Example.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<ProjectReference Include="../../src/Fornax.Seo/Fornax.Seo.fsproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Markdig" Version="0.32.0" />
<PackageReference Include="Markdig" Version="0.33.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/FSharp.Data
Submodule FSharp.Data updated 26 files
+1 −1 .config/dotnet-tools.json
+2 −2 docs/library/HtmlProvider.fsx
+2 −2 paket.dependencies
+5 −5 paket.lock
+1 −1 src/FSharp.Data.DesignTime/CommonProviderImplementation/AssemblyResolver.fs
+4 −3 src/FSharp.Data.DesignTime/CommonProviderImplementation/Helpers.fs
+2 −2 src/FSharp.Data.DesignTime/CommonProviderImplementation/QuotationBuilder.fs
+1 −1 src/FSharp.Data.Html.Core/HtmlOperations.fs
+1 −4 src/FSharp.Data.Html.Core/HtmlRuntime.fs
+8 −8 src/FSharp.Data.Http/Http.fs
+2 −2 src/FSharp.Data.Json.Core/JsonValue.fs
+1 −2 src/FSharp.Data.Runtime.Utilities/Caching.fs
+1 −0 src/FSharp.Data.Runtime.Utilities/IO.fs
+13 −6 src/FSharp.Data.Runtime.Utilities/NameUtils.fs
+4 −3 src/FSharp.Data.Runtime.Utilities/StructuralInference.fs
+9 −5 src/FSharp.Data.Runtime.Utilities/StructuralTypes.fs
+6 −4 src/FSharp.Data.Runtime.Utilities/TextConversions.fs
+1 −1 src/FSharp.Data.Runtime.Utilities/TextRuntime.fs
+2 −2 src/FSharp.Data.WorldBank.Core/WorldBankRuntime.fs
+10 −10 src/FSharp.Data.Xml.Core/XmlRuntime.fs
+11 −6 src/FSharp.Data.Xml.Core/XsdInference.fs
+4 −1 tests/FSharp.Data.Core.Tests.CSharp/FSharp.Data.Core.Tests.CSharp.csproj
+3 −0 tests/FSharp.Data.Core.Tests/FSharp.Data.Core.Tests.fsproj
+3 −0 tests/FSharp.Data.DesignTime.Tests/FSharp.Data.DesignTime.Tests.fsproj
+3 −0 tests/FSharp.Data.Reference.Tests/FSharp.Data.Reference.Tests.fsproj
+3 −0 tests/FSharp.Data.Tests/FSharp.Data.Tests.fsproj
4 changes: 2 additions & 2 deletions test/Fornax.Seo.Tests/Fornax.Seo.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<!-- <PackageReference Include="OpenGraph-Net" Version="3.2.6"/> -->
</ItemGroup>
<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions test/Fornax.Seo.Tests/UnitTests.fs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
namespace Fornax.Seo.Tests

module StringAssert =
let Contains (toFind: string, toSearch: string) = NUnit.Framework.Assert.That(toSearch.Contains(toFind))

module UnitTests =
open NUnit.Framework
open Fornax.Seo
open Fornax.Seo.Tags
open Html
open System.Diagnostics

type internal TestKind =
Expand Down Expand Up @@ -77,8 +79,6 @@ module UnitTests =
| Some assertion -> assertion (toCompare, HtmlElement.ToString html)
| None -> Assert.Fail(errorMsg)

member private x.Get opt = defaultArg opt ""

[<Test>]
member x.``Generates JSON-LD tag``() =
let expected = """<script type="application/ld+json">"""
Expand Down Expand Up @@ -221,14 +221,14 @@ module UnitTests =
let bad = { pageInfo with BaseUrl = "/public"; Url = "/news/posting.php" }
let json = JsonLinkData(bad)

Assert.Null(json.MainEntityOfPage.Id)
Assert.That(obj.ReferenceEquals(null, json.MainEntityOfPage.Id))

[<Test>]
member x.``JsonLinkData ignores invalid urls``() =
let bad = { pageInfo with BaseUrl = "@#$%$!://nodomain/"; Url = "/news/topics/index.htm" }
let json = JsonLinkData(bad)

Assert.Null(json.MainEntityOfPage.Id)
Assert.That(obj.ReferenceEquals(null, json.MainEntityOfPage.Id))

[<Test>]
member x.``Validates ContentObject's Schema.org Type``() =
Expand Down

0 comments on commit 8e045e2

Please sign in to comment.