Skip to content

Commit

Permalink
Unit tests correction after fixing change in AccountXDataDetails: met…
Browse files Browse the repository at this point in the history
…hod Update checked wrong flag POST_COST_VIRTUAL (instead of POST_VIRTUAL) so it triggered incorrect increment of PostsVirtualsCount. Original Ledger code uses valid flag (see account_t::xdata_t::details_t::update), so the fix is correct and related unit test should be changed.
  • Loading branch information
Dmitry Merzlyakov committed Sep 23, 2021
1 parent 021c08b commit dc803b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/NLedger.Tests/Accounts/AccountXDataDetailsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void AccountXDataDetails_Update_IncreasesCounters()
details.Update(post);

Assert.Equal(1, details.PostsCount);
Assert.Equal(1, details.PostsVirtualsCount);
Assert.Equal(0, details.PostsVirtualsCount);
Assert.Equal(1, details.PostsThisMountCount);
Assert.Equal(1, details.PostsLast30Count);
Assert.Equal(1, details.PostsLast7Count);
Expand Down Expand Up @@ -132,7 +132,7 @@ public void AccountXDataDetails_Add_AddsTwoDetails()
AccountXDataDetails details = details2.Add(details1);

Assert.Equal(5, details.PostsCount);
Assert.Equal(5, details.PostsVirtualsCount);
Assert.Equal(0, details.PostsVirtualsCount);
Assert.Equal(5, details.PostsClearedCount);
Assert.Equal(5, details.PostsLast7Count);
Assert.Equal(5, details.PostsLast30Count);
Expand Down

0 comments on commit dc803b8

Please sign in to comment.