Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
│ ├── AsyncObservable.fs – Async flavour (cold `Async` terminals, `mapAsync`, `ofAsync`)
│ └── TaskObservable.fs – Task flavour (hot `Task` terminals, `mapAsync`, `ofTask`)
├── tests/FSharp.Control.R3.Tests/ – MSTest test project
│ ├── TestCategories.fs – test category attributes for `--filter TestCategory=...`
│ ├── BuilderTests.fs – builder behavior tests
│ └── ObservableTests.fs – observable behavior tests
├── build/ – FAKE build scripts and release automation
Expand Down
2 changes: 1 addition & 1 deletion tests/FSharp.Control.R3.Tests/BuilderTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ open FSharp.Control.R3.Observable.Builders
open Microsoft.VisualStudio.TestTools.UnitTesting
open Swensen.Unquote

[<TestClass>]
[<TestClass; BuilderTestCategory>]
type BuilderTests () =

[<TestMethod>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="TestCategories.fs" />
<Compile Include="BuilderTests.fs" />
<Compile Include="ObservableTests.fs" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/FSharp.Control.R3.Tests/ObservableTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ open FSharp.Control.R3.Async
open Microsoft.VisualStudio.TestTools.UnitTesting
open Swensen.Unquote

[<TestClass>]
[<TestClass; ObservableTestCategory>]
type ObservableTests () =

[<TestMethod>]
Expand Down
65 changes: 65 additions & 0 deletions tests/FSharp.Control.R3.Tests/TestCategories.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Every TestCategoryBaseAttribute descendant used to categorize the tests of this project, one per tested component.
// MSTest picks up their TestCategories through --filter TestCategory=... exactly like [<TestCategory>]'s,
// but each attribute is self-sufficient: no separate string constant is needed to know what to pass it.
namespace FSharp.Control.R3.Tests

open System.Collections.Generic
open Microsoft.VisualStudio.TestTools.UnitTesting

/// <summary>
/// Categorizes the tests of <see cref="T:FSharp.Control.R3.ProcessingOptions"/> and
/// <see cref="T:FSharp.Control.R3.AwaitOperationConfiguration"/>.
/// </summary>
type ProcessingOptionsTestCategoryAttribute () =
inherit TestCategoryBaseAttribute ()
override _.TestCategories = [| "ProcessingOptions" |] :> IList<string>

/// <summary>
/// Categorizes the tests of the functions of the <see cref="T:FSharp.Control.R3.Observable"/> module,
/// of <see cref="T:FSharp.Control.R3.ObservableOption"/> and of the <see cref="T:FSharp.Control.R3.ObservableFactories.Observable"/> factories.
/// </summary>
type ObservableTestCategoryAttribute () =
inherit TestCategoryBaseAttribute ()
override _.TestCategories = [| "Observable" |] :> IList<string>

/// <summary>
/// Categorizes the tests of the chunking functions and of <see cref="T:FSharp.Control.R3.ChunkConfiguration`1"/>.
/// </summary>
type ChunkTestCategoryAttribute () =
inherit TestCategoryBaseAttribute ()
override _.TestCategories = [| "Chunk" |] :> IList<string>

/// <summary>
/// Categorizes the tests of the <see cref="T:FSharp.Control.R3.Observable.BuildersModule.RxQueryBuilder"/> query builder.
/// </summary>
type BuilderTestCategoryAttribute () =
inherit TestCategoryBaseAttribute ()
override _.TestCategories = [| "Builder" |] :> IList<string>

/// <summary>
/// Categorizes the tests of the Async flavour, <see cref="T:FSharp.Control.R3.Async"/>.
/// </summary>
type AsyncTestCategoryAttribute () =
inherit TestCategoryBaseAttribute ()
override _.TestCategories = [| "Async" |] :> IList<string>

/// <summary>
/// Categorizes the tests of the Task flavour, <see cref="T:FSharp.Control.R3.Task"/>.
/// </summary>
type TaskTestCategoryAttribute () =
inherit TestCategoryBaseAttribute ()
override _.TestCategories = [| "Task" |] :> IList<string>

/// <summary>
/// Categorizes the tests of mapAsync, which run every test against both flavours, so they also belong to the Async and Task categories.
/// </summary>
type MapAsyncTestCategoryAttribute () =
inherit TestCategoryBaseAttribute ()
override _.TestCategories = [| "MapAsync"; "Async"; "Task" |] :> IList<string>

/// <summary>
/// Categorizes the end-to-end scenarios that combine several areas of the library.
/// </summary>
type IntegrationTestCategoryAttribute () =
inherit TestCategoryBaseAttribute ()
override _.TestCategories = [| "Integration" |] :> IList<string>
Loading