Skip to content

Commit 116c258

Browse files
committed
dividing the yookassa_api.pas
1 parent 9d9707a commit 116c258

15 files changed

+2021
-1167
lines changed

tests/test_yookassa_api.pas

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
interface
66

77
uses
8-
Classes, SysUtils, fpcunit, testregistry, yookassa_api, fpjson
8+
Classes, SysUtils, fpcunit, testregistry, fpjson, yookassa_responses, yookassa_models, yookassa_requests
99
;
1010

1111
type
@@ -114,7 +114,7 @@ procedure TTestYooKassa.CallToJSON;
114114

115115
procedure TTestYooKassa.FillPaymentData(aPayment: TYookassaCreatePaymentRequest);
116116
begin
117-
aPayment.Amount := 123000.45;
117+
aPayment.Amount := 12300.55;
118118
aPayment.Currency := 'RUB';
119119
aPayment.Description := 'Test payment';
120120
aPayment.ReturnUrl:='https://sample.com/';
@@ -175,7 +175,7 @@ procedure TTestYooKassa.TestBuildRequestData;
175175
o.Free;
176176
end;
177177
AssertTrue(Pos('"amount"', aJSON) > 0);
178-
AssertTrue(Pos('"value" : "123000.45"', aJSON) > 0);
178+
AssertTrue(Pos('"value" : "12300.55"', aJSON) > 0);
179179
end;
180180

181181
procedure TTestYooKassa.TestCreatePaymentStatic;
@@ -782,4 +782,5 @@ procedure TTestYooKassa.TestMarkCodeInfoValidation;
782782

783783
initialization
784784
RegisterTest(TTestYooKassa);
785+
785786
end.

tests/test_yookassa_api_gui.lpi

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
<IsPartOfProject Value="True"/>
114114
</Unit>
115115
<Unit>
116-
<Filename Value="..\yookassa_api.pas"/>
116+
<Filename Value="..\yookassa_responses.pas"/>
117117
<IsPartOfProject Value="True"/>
118118
</Unit>
119119
<Unit>
@@ -124,6 +124,14 @@
124124
<Filename Value="test_yookassa_webhook.pas"/>
125125
<IsPartOfProject Value="True"/>
126126
</Unit>
127+
<Unit>
128+
<Filename Value="..\yookassa_models.pas"/>
129+
<IsPartOfProject Value="True"/>
130+
</Unit>
131+
<Unit>
132+
<Filename Value="..\yookassa_requests.pas"/>
133+
<IsPartOfProject Value="True"/>
134+
</Unit>
127135
</Units>
128136
</ProjectOptions>
129137
<CompilerOptions>

tests/test_yookassa_api_gui.lpr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
{$mode objfpc}{$H+}
44

55
uses
6-
Interfaces, Forms, GuiTestRunner, test_yookassa_api, test_yookassa_webhook
7-
;
6+
Interfaces, Forms, GuiTestRunner, test_yookassa_api, test_yookassa_webhook, yookassa_models;
87

98
{$R *.res}
109

tests/test_yookassa_api_integration.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
interface
66

77
uses
8-
Classes, SysUtils, fpcunit, testregistry, fpjson, yookassa_api, eventlog
8+
Classes, SysUtils, fpcunit, testregistry, fpjson, eventlog, yookassa_responses, yookassa_models, yookassa_requests
99
;
1010

1111
type

tests/test_yookassa_api_integration_gui.lpi

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,11 @@
115115
<IsPartOfProject Value="True"/>
116116
</Unit>
117117
<Unit>
118-
<Filename Value="tests_test_yookassa_api_integration.pas"/>
119-
<IsPartOfProject Value="True"/>
120-
<UnitName Value="test_yookassa_api_integration"/>
121-
</Unit>
122-
<Unit>
123-
<Filename Value="..\yookassa_api.pas"/>
118+
<Filename Value="..\yookassa_exceptions.pas"/>
124119
<IsPartOfProject Value="True"/>
125120
</Unit>
126121
<Unit>
127-
<Filename Value="..\yookassa_exceptions.pas"/>
122+
<Filename Value="..\yookassa_responses.pas"/>
128123
<IsPartOfProject Value="True"/>
129124
</Unit>
130125
</Units>

tests/test_yookassa_api_integration_gui.lpr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{$mode objfpc}{$H+}
44

55
uses
6-
Interfaces, Forms, GuiTestRunner, test_yookassa_api_integration
6+
Interfaces, Forms, GuiTestRunner, test_yookassa_api_integration, yookassa_responses
77
;
88

99
{$R *.res}

0 commit comments

Comments
 (0)