-
-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added additional F# unit tests for good measure
- Required putting the Target type in a separate shared library to avoid a circular dependency - Moved Fsharp acceptance tests to different test classes to avoid affecting other tests due to the specific serializer used for F#
- Loading branch information
nkosi23
committed
Dec 11, 2024
1 parent
5217d11
commit d3b20b4
Showing
9 changed files
with
123 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<LangVersion>8.0</LangVersion> | ||
<TargetFrameworks>net8.0;net7.0;net9.0</TargetFrameworks> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="Library.fs"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\LinqTestsTypes\LinqTestsTypes.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using LinqTests.Acceptance.Support; | ||
using Microsoft.FSharp.Core; | ||
using Xunit.Abstractions; | ||
|
||
namespace LinqTests.Acceptance; | ||
|
||
public class where_clauses_fsharp: LinqTestContext<where_clauses_fsharp> | ||
{ | ||
public where_clauses_fsharp(DefaultQueryFixture fixture, ITestOutputHelper output) : base(fixture) | ||
{ | ||
TestOutput = output; | ||
} | ||
|
||
static where_clauses_fsharp() | ||
{ | ||
|
||
@where(x => x.FSharpBoolOption == FSharpOption<bool>.Some(true)); | ||
@where(x => x.FSharpBoolOption == FSharpOption<bool>.Some(false)); | ||
@where(x => x.FSharpDateOption == FSharpOption<DateTime>.Some(DateTime.Now)); | ||
@where(x => x.FSharpIntOption == FSharpOption<int>.Some(300)); | ||
@where(x => x.FSharpStringOption == FSharpOption<string>.Some("My String")); | ||
@where(x => x.FSharpLongOption == FSharpOption<long>.Some(5_000_000)); | ||
|
||
//Comparing options is not a valid syntax in C#, we therefore define these expressions in F# | ||
@where(FSharpTypes.greaterThanWithFsharpDateOption); | ||
@where(FSharpTypes.lesserThanWithFsharpDateOption); | ||
@where(FSharpTypes.greaterThanWithFsharpStringOption); | ||
@where(FSharpTypes.lesserThanWithFsharpStringOption); | ||
@where(FSharpTypes.greaterThanWithFsharpDecimalOption); | ||
@where(FSharpTypes.lesserThanWithFsharpDecimalOption); | ||
} | ||
|
||
[Theory] | ||
[MemberData(nameof(GetDescriptions))] | ||
public Task run_query(string description) | ||
{ | ||
return assertTestCase(description, Fixture.FSharpFriendlyStore); | ||
} | ||
|
||
[Theory] | ||
[MemberData(nameof(GetDescriptions))] | ||
public Task with_duplicated_fields(string description) | ||
{ | ||
return assertTestCase(description, Fixture.FSharpFriendlyStoreWithDuplicatedField); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.