Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-pajurek committed Oct 12, 2024
1 parent 264d2e6 commit 9a7648d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,20 @@ Namespace: `Spotflow.InMemory.Azure.Storage.FluentAssertions`

### `BlobClientBase`

- `.Should().ExistAsync(...)`: returns immediately if the blob exists or waits for some time for the blob to be created before failing.
`.Should()`

- `.Exist()`: asserts that the blob exist at the given time..
- `.Exist(TimeSpan waitTime)`: returns immediately if the blob exist or waits for some time for the blob to be deleted before failing.
- `.MatchName(string expectedNamePattern)`: asserts that the blob name matches expected FluentAssertion wildcard pattern.
- `.HaveSize()`: asserts that blob size equals to expected size.
- `.BeEmpty()`: asserts that blob size is 0.
- `.HaveContent(string expectedContent)`: interprets blob content as UTF-8 string and asserts it equals to the expected content.
- `.HaveCommittedBlocks(int expectedCount)`: asserts that blob has expected number of committed blocks.
- `.HaveCommittedBlocksWithSizes(int?[] expectedBlockSizes)`: asserts that blob has expected number of committed blocks with expected sizes.
- `.HaveCommittedBlock(int blockOrdinal, Action<BlobBlock> blockAssertion)`: asserts that blob has committed block with expected properties.
- `.HaveNoCommittedBlocks()`: asserts that blob has no committed blocks.
- `.HaveUncommittedBlocks(int expectedCount)`: asserts that blob has expected number of uncommitted blocks.
- `.HaveNoUncommittedBlocks()`: asserts that blob has no uncommitted blocks.

## Hooks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ public AndConstraint<BlobBaseClientAssertions> HaveNoUncommittedBlocks(string? b
return HaveUncommittedBlocks(0, because: because, becauseArgs: becauseArgs);
}


/// <summary>
/// Asserts that blob has expected number of committed blocks with expected sizes.
/// </summary>
/// <param name="expectedBlockSizes">
/// Expected sizes of individual blocks in the block list order.
/// If an item in the array is set to <c>null</c>, the size of the particular block is not checked.
/// </param>
/// <returns></returns>
[CustomAssertion]
public AndConstraint<BlobBaseClientAssertions> HaveCommittedBlocksWithSizes(int?[] expectedBlockSizes, string? because = null, params object[] becauseArgs)
{
Expand Down

0 comments on commit 9a7648d

Please sign in to comment.