Skip to content

Instantly share code, notes, and snippets.

@CoditCompany
Last active February 18, 2020 16:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CoditCompany/b3d16426362595849a8be0ec579379a2 to your computer and use it in GitHub Desktop.
Save CoditCompany/b3d16426362595849a8be0ec579379a2 to your computer and use it in GitHub Desktop.
F# reactive marble testing of the filter operator
[<Fact>]
let ``filter emit only those items from an observable that pass a predicate test`` () =
TestSchedule.usage <| fun sch ->
let stub = cold "--2-(30)--(22)-5--(60)-1--|" sch
let expected = "-- -(30)--(22)- --(60)- --|"
stub |> Observable.filter (fun x -> int x > 10)
|> Marbles.expectMessages sch expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment