Skip to content

Commit

Permalink
get balanceMovements api test case has been added
Browse files Browse the repository at this point in the history
  • Loading branch information
mElzantot committed Sep 23, 2024
1 parent 2578068 commit be21c10
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/Balance/SubsBase.SDK.Balance.Test/BalanceTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FluentAssertions;
using Subsbase.Balance.Inputs;
using SubsBase.SDK.Balance.Contracts;

namespace SubsBase.SDK.Balance.Test;
Expand Down Expand Up @@ -68,7 +69,7 @@ public void Step_03_AddCreditBalanceMovement_ShouldLoadBalanceWithSpecificAmount
BalanceId = _1StBalanceId,
Type = MovementType.Credit,
Amount = 1000,
Description = "Load Balance With 1000 EGP",
Description = "Load Balance With 1000 EGP - settle invoice",
}).GetAwaiter().GetResult();

balance.IsSuccess.Should().BeTrue();
Expand Down Expand Up @@ -312,4 +313,22 @@ public void Step_17_GetAllBalancesOnHoldAmountsDetails_ShouldGetAllOnHoldAmounts
balance.Value.OnHoldAmounts.Sum(x => x.Amount).Should().Be(200);
}

[Test, Order(18)]
public void Step_18_GetAllBalanceMovements_ShouldGetAlBalanceMovements()
{
var balance = balanceSdk.BalanceMovement.GetAsync(
balanceId: _1StBalanceId,
filter: new FilterInput(){ SearchTerm = "invoice"},
sorting: new SortingInput{ SortBy = "amount" , SortDirection = SortingDirection.Descending},
pagination: new PaginationInput {PageNumber = 1, PageSize = 100}
).GetAwaiter().GetResult();
balance.Should().NotBeNull();
balance.IsSuccess.Should().BeTrue();
balance.Value.Should().NotBeNull();

balance.Value.TotalRecords.Should();
balance.Value.Data.FirstOrDefault().NetBalance.Should().BePositive();
}


}

0 comments on commit be21c10

Please sign in to comment.