-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
425 additions
and
253 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
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
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
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,28 @@ | ||
using FluentAssertions; | ||
using Paprika.Chain; | ||
|
||
namespace Paprika.Tests.Chain; | ||
|
||
public class StorageStatsTests | ||
{ | ||
[TestCase(new[] { true, true }, true, TestName = "Set & Set")] | ||
[TestCase(new[] { true, false }, false, TestName = "Set & Delete")] | ||
[TestCase(new[] { false, true }, true, TestName = "Delete & Set")] | ||
[TestCase(new[] { false, false }, false, TestName = "Delete & Delete")] | ||
public void Scenarios(bool[] operations, bool expected) | ||
{ | ||
var stats = new StorageStats(); | ||
var key = Values.Key0; | ||
|
||
foreach (var operation in operations) | ||
{ | ||
stats.SetStorage(key, operation ? [1] : []); | ||
} | ||
|
||
(expected ? stats.Set : stats.Deleted).Should().Contain(key); | ||
(expected ? stats.Deleted : stats.Set).Should().BeEmpty(); | ||
|
||
stats.Set.Intersect(stats.Deleted).Should() | ||
.BeEmpty("The sets of deleted and set should always have no shared elements"); | ||
} | ||
} |
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
Oops, something went wrong.