Skip to content

Commit ca6863c

Browse files
authored
Merge pull request #27 from 21johnh21/HAWL/SWE-rename-UnitStatsDetail
Make _UnitStatsDetail a public class
2 parents 73820f6 + 327e1ea commit ca6863c

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed
File renamed without changes.

testing/Project/Sources/Classes/UnitStatsTracker.4dm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Function resetStatistics()
1414
If (This:C1470._statsMap=Null:C1517)
1515
return
1616
End if
17-
var $statistic : cs:C1710._UnitStatsDetail
17+
var $statistic : cs:C1710.UnitStatsDetail
1818
For each ($statistic; OB Values:C1718(This:C1470._statsMap))
1919
If (OB Instance of:C1731($statistic.reset; 4D:C1709.Function))
2020
$statistic.reset()
@@ -26,14 +26,14 @@ Function createStatistic($name : Text) : cs:C1710.UnitStatsTracker
2626
$name - text - the name of the statistic to create
2727
returns - cs.UnitStatsTracker - This object to chain call
2828
*/
29-
This:C1470._statsMap[$name]:=cs:C1710._UnitStatsDetail.new()
29+
This:C1470._statsMap[$name]:=cs:C1710.UnitStatsDetail.new()
3030
return This:C1470
3131

32-
Function getStat($name : Text) : cs:C1710._UnitStatsDetail
32+
Function getStat($name : Text) : cs:C1710.UnitStatsDetail
3333
/* Gets a statistic. If one does not exist, a new statistic will
3434
be created an returned.
3535
$name - text - the name of the statistic to return
36-
returns - cs._UnitStatsDetail - a statistic
36+
returns - cs.UnitStatsDetail - a statistic
3737
*/
3838
If (Not:C34(This:C1470._doesStatisticExist($name)))
3939
This:C1470.createStatistic($name)
@@ -47,7 +47,7 @@ $functionName - text - the name of the statistic to update
4747
$parameters - collection - the collection of parameters to push onto the related statistic
4848
$returnValue - variant - value this method will return
4949
*/
50-
var $statistic : cs:C1710._UnitStatsDetail
50+
var $statistic : cs:C1710.UnitStatsDetail
5151
$statistic:=This:C1470.getStat($functionName)
5252
If ($statistic#Null:C1517)
5353
$statistic.appendCalledParameters((($parameters#Null:C1517) ? $parameters : []))

testing/Project/Sources/Classes/_MockingExampleTest.4dm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Function test_mock_basic_functionality($t : cs:C1710.Testing)
99
$result:=$t.stats.mock("testFunction"; ["param1"; "param2"]; "mock_result")
1010

1111
// Verify the mock was called correctly
12-
var $stat : cs:C1710._UnitStatsDetail
12+
var $stat : cs:C1710.UnitStatsDetail
1313
$stat:=$t.stats.getStat("testFunction")
1414

1515
$t.assert.areEqual($t; 1; $stat.getNumberOfCalls(); "Mock should be called once")
@@ -23,7 +23,7 @@ Function test_mock_multiple_calls($t : cs:C1710.Testing)
2323
$t.stats.mock("validateUser"; ["guest"]; False:C215)
2424

2525
// Verify both calls were tracked
26-
var $stat : cs:C1710._UnitStatsDetail
26+
var $stat : cs:C1710.UnitStatsDetail
2727
$stat:=$t.stats.getStat("validateUser")
2828

2929
$t.assert.areEqual($t; 2; $stat.getNumberOfCalls(); "Should be called twice")
@@ -38,7 +38,7 @@ Function test_mock_with_collections($t : cs:C1710.Testing)
3838
$t.stats.mock("processCollection"; [$testCollection]; "processed")
3939

4040
// Verify collection parameter was captured
41-
var $stat : cs:C1710._UnitStatsDetail
41+
var $stat : cs:C1710.UnitStatsDetail
4242
$stat:=$t.stats.getStat("processCollection")
4343

4444
$t.assert.areEqual($t; 1; $stat.getNumberOfCalls(); "Should be called once")
@@ -53,7 +53,7 @@ Function test_mock_statistics_reset($t : cs:C1710.Testing)
5353
$t.stats.mock("testMethod"; ["param"]; "result")
5454
$t.stats.mock("testMethod"; ["param2"]; "result2")
5555

56-
var $stat : cs:C1710._UnitStatsDetail
56+
var $stat : cs:C1710.UnitStatsDetail
5757
$stat:=$t.stats.getStat("testMethod")
5858
$t.assert.areEqual($t; 2; $stat.getNumberOfCalls(); "Should have 2 calls before reset")
5959

@@ -72,7 +72,7 @@ Function test_mock_parameter_details($t : cs:C1710.Testing)
7272
$t.stats.mock("apiCall"; $params; New object:C1471("status"; 200; "data"; "success"))
7373

7474
// Verify parameter details
75-
var $stat : cs:C1710._UnitStatsDetail
75+
var $stat : cs:C1710.UnitStatsDetail
7676
$stat:=$t.stats.getStat("apiCall")
7777

7878
$t.assert.areEqual($t; 1; $stat.getNumberOfCalls(); "Should be called once")

testing/Project/Sources/Classes/_TestingTest.4dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Function test_run_subtest_stats_isolated($t : cs:C1710.Testing)
184184
$testing.run("second"; Formula($1.assert.areEqual($1; 0; $1.stats.getStat("mocked").getNumberOfCalls(); "Stats should not carry over between subtests")))
185185

186186
// Parent stats should remain unaffected
187-
var $parentStat : cs:C1710._UnitStatsDetail
187+
var $parentStat : cs:C1710.UnitStatsDetail
188188
$parentStat:=$testing.stats.getStat("mocked")
189189
$t.assert.areEqual($t; 0; $parentStat.getNumberOfCalls(); "Parent stats should remain unaffected")
190190

testing/Resources/en.lproj/syntaxEN.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"Summary": ""
8282
}
8383
},
84-
"_UnitStatsDetail": {
84+
"UnitStatsDetail": {
8585
"new()": {
8686
"Syntax": "**.new**()",
8787
"Params": [],
@@ -931,7 +931,7 @@
931931
"Summary": ""
932932
}
933933
},
934-
"_UnitStatsDetail": {
934+
"UnitStatsDetail": {
935935
"getXCallParamLength()": {
936936
"Syntax": "**.getXCallParamLength**( *xCall* : Integer ) : Integer",
937937
"Params": [
@@ -2396,7 +2396,7 @@
23962396
"Summary": ""
23972397
},
23982398
"getStat()": {
2399-
"Syntax": "**.getStat**( *name* : Text ) : cs.Testing._UnitStatsDetail",
2399+
"Syntax": "**.getStat**( *name* : Text ) : cs.Testing.UnitStatsDetail",
24002400
"Params": [
24012401
[
24022402
"name",
@@ -2405,7 +2405,7 @@
24052405
],
24062406
[
24072407
"",
2408-
"cs.Testing._UnitStatsDetail",
2408+
"cs.Testing.UnitStatsDetail",
24092409
"<-"
24102410
]
24112411
],

0 commit comments

Comments
 (0)