Skip to content

Commit 97db001

Browse files
committed
feat(solution): remove Expecto and add MSTest 3 and Unquote
1 parent f1f3ba7 commit 97db001

File tree

15 files changed

+740
-709
lines changed

15 files changed

+740
-709
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
"ghcr.io/devcontainers-contrib/features/starship:1": {},
2424
// https://github.com/devcontainers/features/blob/main/src/dotnet/README.md
2525
"ghcr.io/devcontainers/features/dotnet:2": {
26-
"version": "7.0",
27-
"additionalVersions": "6.0"
26+
"version": "8.0"
2827
}
2928
},
3029
"overrideFeatureInstallOrder": [
@@ -70,4 +69,4 @@
7069
"restore": "dotnet tool restore && dotnet restore"
7170
},
7271
"waitFor": "updateContentCommand"
73-
}
72+
}

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ jobs:
2323
with:
2424
global-json-file: global.json
2525
dotnet-version: |
26-
6.x
27-
7.x
26+
8.x
2827
2928
- name: Build via Bash
3029
if: runner.os != 'Windows'

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
global-json-file: global.json
2323
dotnet-version: |
24-
6.x
24+
8.x
2525
- name: publish
2626
env:
2727
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}

.paket/Paket.Restore.targets

Lines changed: 503 additions & 503 deletions
Large diffs are not rendered by default.

build/build.fsproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33

44
<PropertyGroup>
55
<OutputType>Exe</OutputType>
6-
<TargetFramework>net6.0</TargetFramework>
6+
<TargetFramework>net8.0</TargetFramework>
77
<WarnOn>3390;$(WarnOn)</WarnOn>
88
<IsPackable>false</IsPackable>
99
</PropertyGroup>
1010

11+
<ItemGroup>
12+
<None Include="paket.references" />
13+
</ItemGroup>
14+
1115
<ItemGroup>
1216
<Compile Include="Changelog.fs" />
1317
<Compile Include="FsDocs.fs" />
1418
<Compile Include="build.fs" />
1519
</ItemGroup>
16-
</Project>
20+
</Project>

build/paket.references

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
Unquote
12
group Build
3+
Argu
24
FSharp.Core
35
Fake.IO.FileSystem
46
Fake.Core.Target
@@ -11,5 +13,6 @@ Fake.Tools.Git
1113
Fake.DotNet.Paket
1214
Fake.Api.GitHub
1315
Fake.BuildServer.GitHubActions
14-
Argu
1516
Octokit
17+
NuGet.Common
18+
NuGet.Protocol

global.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"sdk": {
3-
"version": "6.0.100",
4-
"rollForward": "feature"
3+
"version": "8.0.403",
4+
"allowPrerelease": false,
5+
"rollForward": "latestMinor"
56
}
67
}

paket.dependencies

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
source https://www.nuget.org/api/v2
22
source https://api.nuget.org/v3/index.json
33
storage: none
4-
nuget FSharp.Core >= 6.0 lowest_matching: true
4+
5+
nuget FSharp.Core >= 8.0 lowest_matching: true
56
nuget Microsoft.SourceLink.GitHub copy_local: true
6-
nuget Expecto
7-
nuget YoloDev.Expecto.TestSdk
8-
nuget Microsoft.NET.Test.Sdk
97
nuget altcover
8+
nuget Microsoft.NET.Test.Sdk
9+
nuget System.Security.Cryptography.ProtectedData
10+
11+
nuget MSTest.TestAdapter
12+
nuget MSTest.TestFramework
13+
nuget Unquote
1014

1115
// [ FAKE GROUP ]
1216
group Build
1317
storage: none
1418
source https://www.nuget.org/api/v2
1519
source https://api.nuget.org/v3/index.json
20+
nuget NuGet.Common
21+
nuget NuGet.Protocol
1622
nuget Fake.IO.FileSystem
1723
nuget Fake.Core.Target
1824
nuget Fake.Core.ReleaseNotes
@@ -26,12 +32,12 @@ group Build
2632
nuget Fake.BuildServer.GitHubActions
2733
nuget Argu
2834
nuget Octokit
29-
nuget Microsoft.Build 17.3.2
30-
nuget Microsoft.Build.Framework 17.3.2
31-
nuget Microsoft.Build.Tasks.Core 17.3.2
32-
nuget Microsoft.Build.Utilities.Core 17.3.2
35+
nuget Microsoft.Build 17.12.6
36+
nuget Microsoft.Build.Framework 17.12.6
37+
nuget Microsoft.Build.Tasks.Core 17.12.6
38+
nuget Microsoft.Build.Utilities.Core 17.12.6
3339

3440
group Analyzers
3541
source https://www.nuget.org/api/v2
3642
source https://api.nuget.org/v3/index.json
37-
nuget BinaryDefense.FSharp.Analyzers.Hashing 0.2.2
43+
nuget BinaryDefense.FSharp.Analyzers.Hashing 0.2.2

paket.lock

Lines changed: 149 additions & 129 deletions
Large diffs are not rendered by default.

src/FSharp.Control.R3/FSharp.Control.R3.fsproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<Import Project="..\..\.paket\Paket.Restore.targets" />
33

44
<PropertyGroup>
5-
<TargetFrameworks>net6.0</TargetFrameworks>
5+
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
6+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
67
</PropertyGroup>
78

89
<PropertyGroup>
@@ -15,10 +16,15 @@
1516
<Tailcalls>true</Tailcalls>
1617
</PropertyGroup>
1718

19+
<ItemGroup>
20+
<None Include="paket.references" />
21+
</ItemGroup>
22+
1823
<ItemGroup>
1924
<Compile Include="AssemblyInfo.fs" />
2025
<Compile Include="Library.fs" />
2126
</ItemGroup>
2227

2328
<Import Project="..\..\.paket\Paket.Restore.targets" />
2429
</Project>
30+
</Project>

src/FSharp.Control.R3/Library.fs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ module Say =
1515

1616
/// <summary> A person with many different field types </summary>
1717
type Person = {
18-
Name: string
19-
FavoriteNumber: int
20-
FavoriteColor: FavoriteColor
21-
DateOfBirth: DateTimeOffset
18+
Name : string
19+
FavoriteNumber : int
20+
FavoriteColor : FavoriteColor
21+
DateOfBirth : DateTimeOffset
2222
}
2323

2424
/// <summary>Says hello to a specific person</summary>
25-
let helloPerson (person: Person) =
25+
let helloPerson (person : Person) =
2626
sprintf
2727
"Hello %s. You were born on %s and your favorite number is %d. You like %A."
2828
person.Name
29-
(person.DateOfBirth.ToString("yyyy/MM/dd", Globalization.CultureInfo.InvariantCulture))
29+
(person.DateOfBirth.ToString ("yyyy/MM/dd", Globalization.CultureInfo.InvariantCulture))
3030
person.FavoriteNumber
3131
person.FavoriteColor
3232

@@ -51,6 +51,4 @@ module Say =
5151

5252

5353
/// I do nothing
54-
let nothing name =
55-
name
56-
|> ignore
54+
let nothing name = name |> ignore

tests/FSharp.Control.R3.Tests/FSharp.Control.R3.Tests.fsproj

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33

44
<PropertyGroup>
55
<OutputType>Exe</OutputType>
6-
<TargetFramework>net6.0</TargetFramework>
7-
<GenerateProgramFile>false</GenerateProgramFile>
6+
<TargetFramework>net8.0</TargetFramework>
87
</PropertyGroup>
98

109
<ItemGroup>
11-
<ProjectReference Include="../../src/FSharp.Control.R3/FSharp.Control.R3.fsproj" />
10+
<None Include="paket.references" />
1211
</ItemGroup>
1312

14-
<ItemGroup>
13+
<ItemGroup>
1514
<Compile Include="Tests.fs" />
16-
<Compile Include="Main.fs" />
1715
</ItemGroup>
18-
</Project>
1916

17+
<ItemGroup>
18+
<ProjectReference Include="../../src/FSharp.Control.R3/FSharp.Control.R3.fsproj" />
19+
</ItemGroup>
20+
</Project>

tests/FSharp.Control.R3.Tests/Main.fs

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
namespace FSharp.Control.R3.Tests
22

33
open System
4-
open Expecto
54
open FSharp.Control.R3
65
open FSharp.Control.R3.Say
6+
open Microsoft.VisualStudio.TestTools.UnitTesting
7+
open Swensen.Unquote
78

8-
module SayTests =
9-
[<Tests>]
10-
let tests =
11-
testList "samples" [
12-
testCase "Add two integers"
13-
<| fun _ ->
14-
let subject = Say.add 1 2
15-
Expect.equal subject 3 "Addition works"
16-
testCase "Say nothing"
17-
<| fun _ ->
18-
let subject = Say.nothing ()
19-
Expect.equal subject () "Not an absolute unit"
20-
testCase "Say hello all"
21-
<| fun _ ->
22-
let person = {
23-
Name = "Jean-Luc Picard"
24-
FavoriteNumber = 4
25-
FavoriteColor = Red
26-
DateOfBirth = DateTimeOffset.Parse("July 13, 2305")
27-
}
28-
29-
let subject = Say.helloPerson person
30-
31-
Expect.equal
32-
subject
33-
"Hello Jean-Luc Picard. You were born on 2305/07/13 and your favorite number is 4. You like Red."
34-
"You didn't say hello"
35-
]
9+
[<TestClass>]
10+
type SayTests () =
11+
12+
member _.``Add two integers`` () =
13+
let subject = Say.add 1 2
14+
test <@ subject = 3 @>
15+
//Assert.AreEqual (subject, 3, message = "Addition works")
16+
17+
member _.``Say nothing`` () =
18+
let subject = Say.nothing ()
19+
Assert.AreEqual (subject, (), "Not an absolute unit")
20+
21+
member _.``Say hello all`` () =
22+
let person = {
23+
Name = "Jean-Luc Picard"
24+
FavoriteNumber = 4
25+
FavoriteColor = Red
26+
DateOfBirth = DateTimeOffset.Parse ("July 13, 2305")
27+
}
28+
29+
let subject = Say.helloPerson person
30+
31+
test <@ subject = "Hello Jean-Luc Picard. You were born on 2305/07/13 and your favorite number is 4. You like Red." @>
32+
33+
//Assert.AreEqual<String> (
34+
// subject,
35+
// "Hello Jean-Luc Picard. You were born on 2305/07/13 and your favorite number is 4. You like Red.",
36+
// message = "You didn't say hello"
37+
//)
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
Expecto
1+
altcover
22
FSharp.Core
33
Microsoft.NET.Test.Sdk
4-
YoloDev.Expecto.TestSdk
5-
altcover
4+
MSTest.TestAdapter
5+
MSTest.TestFramework
6+
Unquote

0 commit comments

Comments
 (0)