From be21c10c9fddca7f00d36fd522b9d721a491db9d Mon Sep 17 00:00:00 2001 From: Mohamed Shaker Date: Mon, 23 Sep 2024 13:58:01 +0300 Subject: [PATCH] get balanceMovements api test case has been added --- .../SubsBase.SDK.Balance.Test/BalanceTests.cs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Balance/SubsBase.SDK.Balance.Test/BalanceTests.cs b/src/Balance/SubsBase.SDK.Balance.Test/BalanceTests.cs index 506cd68..8b857e0 100644 --- a/src/Balance/SubsBase.SDK.Balance.Test/BalanceTests.cs +++ b/src/Balance/SubsBase.SDK.Balance.Test/BalanceTests.cs @@ -1,4 +1,5 @@ using FluentAssertions; +using Subsbase.Balance.Inputs; using SubsBase.SDK.Balance.Contracts; namespace SubsBase.SDK.Balance.Test; @@ -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(); @@ -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(); + } + + } \ No newline at end of file