-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct (and tune)
equinox-sync
template progress/error management (#…
…19)
- Loading branch information
Showing
7 changed files
with
521 additions
and
194 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
4 changes: 2 additions & 2 deletions
4
equinox-sync/Sync.Tests/Tests.fs → ...ox-sync/Sync.Tests/CosmosIngesterTests.fs
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,38 @@ | ||
module ProgressTests | ||
|
||
open SyncTemplate.Program | ||
|
||
open Swensen.Unquote | ||
open Xunit | ||
|
||
let [<Fact>] ``Empty has zero streams pending or progress to write`` () = | ||
let sut = Progress.State<_>() | ||
let validatedPos, batches = sut.Validate(fun _ -> None) | ||
None =! validatedPos | ||
0 =! batches | ||
|
||
let [<Fact>] ``Can add multiple batches`` () = | ||
let sut = Progress.State<_>() | ||
sut.AppendBatch(0,["a",1L; "b",2L]) | ||
sut.AppendBatch(1,["b",2L; "c",3L]) | ||
let validatedPos, batches = sut.Validate(fun _ -> None) | ||
None =! validatedPos | ||
2 =! batches | ||
|
||
let [<Fact>] ``Marking Progress Removes batches and updates progress`` () = | ||
let sut = Progress.State<_>() | ||
sut.AppendBatch(0,["a",1L; "b",2L]) | ||
sut.MarkStreamProgress("a",1L) | ||
sut.MarkStreamProgress("b",1L) | ||
let validatedPos, batches = sut.Validate(fun _ -> None) | ||
None =! validatedPos | ||
1 =! batches | ||
|
||
let [<Fact>] ``Marking progress is not persistent`` () = | ||
let sut = Progress.State<_>() | ||
sut.AppendBatch(0,["a",1L]) | ||
sut.MarkStreamProgress("a",2L) | ||
sut.AppendBatch(1,["a",1L; "b",2L]) | ||
let validatedPos, batches = sut.Validate(fun _ -> None) | ||
Some 0 =! validatedPos | ||
1 =! batches |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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