diff --git a/docs/storage.md b/docs/storage.md index 2bbd160..43256ff 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -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 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 diff --git a/src/Spotflow.InMemory.Azure.Storage.FluentAssertions/BlobBaseClientAssertions.cs b/src/Spotflow.InMemory.Azure.Storage.FluentAssertions/BlobBaseClientAssertions.cs index 4fc4e3c..2323ed9 100644 --- a/src/Spotflow.InMemory.Azure.Storage.FluentAssertions/BlobBaseClientAssertions.cs +++ b/src/Spotflow.InMemory.Azure.Storage.FluentAssertions/BlobBaseClientAssertions.cs @@ -139,6 +139,15 @@ public AndConstraint HaveNoUncommittedBlocks(string? b return HaveUncommittedBlocks(0, because: because, becauseArgs: becauseArgs); } + + /// + /// Asserts that blob has expected number of committed blocks with expected sizes. + /// + /// + /// Expected sizes of individual blocks in the block list order. + /// If an item in the array is set to null, the size of the particular block is not checked. + /// + /// [CustomAssertion] public AndConstraint HaveCommittedBlocksWithSizes(int?[] expectedBlockSizes, string? because = null, params object[] becauseArgs) {