Skip to content

Commit cff89ad

Browse files
author
Jamil Maqdis Anton
committed
add test directory
1 parent 67fcb76 commit cff89ad

File tree

5 files changed

+79
-0
lines changed

5 files changed

+79
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@
77

88
src/bin
99
src/obj
10+
tests/bin
11+
tests/obj
12+
1013
Release/

SqlStreamStore.FSharp.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.26124.0
55
MinimumVisualStudioVersion = 15.0.26124.0
66
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "SqlStreamStore.FSharp", "src\SqlStreamStore.FSharp.fsproj", "{22955019-D275-45AB-AD7C-B192BDB3F60F}"
77
EndProject
8+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "SqlStreamStore.FSharp.Tests", "tests\SqlStreamStore.FSharp.Tests.fsproj", "{377DE082-49F3-4925-8CFF-5A24329B5512}"
9+
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Any CPU = Debug|Any CPU
@@ -30,5 +32,17 @@ Global
3032
{22955019-D275-45AB-AD7C-B192BDB3F60F}.Release|x64.Build.0 = Release|Any CPU
3133
{22955019-D275-45AB-AD7C-B192BDB3F60F}.Release|x86.ActiveCfg = Release|Any CPU
3234
{22955019-D275-45AB-AD7C-B192BDB3F60F}.Release|x86.Build.0 = Release|Any CPU
35+
{377DE082-49F3-4925-8CFF-5A24329B5512}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
36+
{377DE082-49F3-4925-8CFF-5A24329B5512}.Debug|Any CPU.Build.0 = Debug|Any CPU
37+
{377DE082-49F3-4925-8CFF-5A24329B5512}.Debug|x64.ActiveCfg = Debug|Any CPU
38+
{377DE082-49F3-4925-8CFF-5A24329B5512}.Debug|x64.Build.0 = Debug|Any CPU
39+
{377DE082-49F3-4925-8CFF-5A24329B5512}.Debug|x86.ActiveCfg = Debug|Any CPU
40+
{377DE082-49F3-4925-8CFF-5A24329B5512}.Debug|x86.Build.0 = Debug|Any CPU
41+
{377DE082-49F3-4925-8CFF-5A24329B5512}.Release|Any CPU.ActiveCfg = Release|Any CPU
42+
{377DE082-49F3-4925-8CFF-5A24329B5512}.Release|Any CPU.Build.0 = Release|Any CPU
43+
{377DE082-49F3-4925-8CFF-5A24329B5512}.Release|x64.ActiveCfg = Release|Any CPU
44+
{377DE082-49F3-4925-8CFF-5A24329B5512}.Release|x64.Build.0 = Release|Any CPU
45+
{377DE082-49F3-4925-8CFF-5A24329B5512}.Release|x86.ActiveCfg = Release|Any CPU
46+
{377DE082-49F3-4925-8CFF-5A24329B5512}.Release|x86.Build.0 = Release|Any CPU
3347
EndGlobalSection
3448
EndGlobal

tests/Main.fs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module tests
2+
open Expecto
3+
4+
[<EntryPoint>]
5+
let main argv =
6+
Tests.runTestsInAssembly defaultConfig argv

tests/Sample.fs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module Tests
2+
3+
open Expecto
4+
5+
[<Tests>]
6+
let tests =
7+
testList "samples" [
8+
testCase "universe exists (╭ರᴥ•́)" <| fun _ ->
9+
let subject = true
10+
Expect.isTrue subject "I compute, therefore I am."
11+
12+
testCase "when true is not (should fail)" <| fun _ ->
13+
let subject = false
14+
Expect.isTrue subject "I should fail because the subject is false"
15+
16+
testCase "I'm skipped (should skip)" <| fun _ ->
17+
Tests.skiptest "Yup, waiting for a sunny day..."
18+
19+
testCase "I'm always fail (should fail)" <| fun _ ->
20+
Tests.failtest "This was expected..."
21+
22+
testCase "contains things" <| fun _ ->
23+
Expect.containsAll [| 2; 3; 4 |] [| 2; 4 |]
24+
"This is the case; {2,3,4} contains {2,4}"
25+
26+
testCase "contains things (should fail)" <| fun _ ->
27+
Expect.containsAll [| 2; 3; 4 |] [| 2; 4; 1 |]
28+
"Expecting we have one (1) in there"
29+
30+
testCase "Sometimes I want to ༼ノಠل͟ಠ༽ノ ︵ ┻━┻" <| fun _ ->
31+
Expect.equal "abcdëf" "abcdef" "These should equal"
32+
33+
test "I am (should fail)" {
34+
"╰〳 ಠ 益 ಠೃ 〵╯" |> Expect.equal true false
35+
}
36+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
<GenerateProgramFile>false</GenerateProgramFile>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<Compile Include="Sample.fs" />
11+
<Compile Include="Main.fs" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<PackageReference Include="Expecto" Version="9.*" />
16+
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="0.*" />
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.*" />
18+
<PackageReference Update="FSharp.Core" Version="4.*" />
19+
</ItemGroup>
20+
</Project>

0 commit comments

Comments
 (0)