Skip to content

Commit 0b2e067

Browse files
committed
format fun
1 parent 77fb482 commit 0b2e067

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ChronoJsonDiffPatch/ChronoJsonDiffPatch/SkipPatchesWithUnmatchedListItems.cs

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public SkipPatchesWithUnmatchedListItems(Func<TEntity, List<TListItem>?> listAcc
1717
{
1818
_listAccessor = listAccessor;
1919
}
20+
2021
/// <summary>
2122
/// <inheritdoc cref="ISkipCondition{TEntity}"/>
2223
/// </summary>
@@ -26,11 +27,13 @@ public bool ShouldSkipPatch(TEntity initialEntity, TimeRangePatch failedPatch, E
2627
{
2728
return false;
2829
}
30+
2931
var list = _listAccessor(initialEntity);
3032
if (list is null)
3133
{
3234
return false;
3335
}
36+
3437
// todo: theoretically I could
3538
// 1. check the json attributes of the list property,
3639
// 2. then inspect the failedPatch.Patch and then

ChronoJsonDiffPatch/ChronoJsonDiffPatchTests/ListPatchingTests.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ public void Reproduce_ArgumentOutOfRangeException()
127127
[Fact]
128128
public void Test_ArgumentOutOfRangeException_Can_Be_Surpressed()
129129
{
130-
var chain = new TimeRangePatchChain<EntityWithList>(skipConditions: new List<ISkipCondition<EntityWithList>> { new SkipPatchesWithUnmatchedListItems<EntityWithList, ListItem>(x => x.MyList) });
130+
var chain = new TimeRangePatchChain<EntityWithList>(skipConditions: new List<ISkipCondition<EntityWithList>>
131+
{ new SkipPatchesWithUnmatchedListItems<EntityWithList, ListItem>(x => x.MyList) });
131132
var initialEntity = new EntityWithList
132133
{
133134
MyList = new List<ListItem>
@@ -155,11 +156,11 @@ public void Test_ArgumentOutOfRangeException_Can_Be_Surpressed()
155156
var patchingACorrectInitialEntity = () => antiparallelChain.PatchToDate(antiparallelInitialEntity, keyDate1 - TimeSpan.FromDays(10));
156157
patchingACorrectInitialEntity.Should().NotThrow();
157158

158-
var corruptedInitialEntity = antiparallelInitialEntity; // we modify the reference here, but that's fine. We improve the readability but don't re-use the antiparallelInitialEntity anywhere downstream.
159+
var corruptedInitialEntity =
160+
antiparallelInitialEntity; // we modify the reference here, but that's fine. We improve the readability but don't re-use the antiparallelInitialEntity anywhere downstream.
159161
corruptedInitialEntity.MyList.RemoveAt(1);
160162
var applyingPatchesToACorruptedInitialEntity = () => antiparallelChain.PatchToDate(corruptedInitialEntity, keyDate1 - TimeSpan.FromDays(10));
161163
applyingPatchesToACorruptedInitialEntity.Should().NotThrow()
162-
// now we expect those patches to be applied, as far as they can be applied. In this case: none ;)
163164
.And.Subject.Invoke().Should().BeEquivalentTo(corruptedInitialEntity);
164165
antiparallelChain.PatchesHaveBeenSkipped.Should().BeTrue();
165166
}

0 commit comments

Comments
 (0)