-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from moosetechnology/develop
Develop
- Loading branch information
Showing
80 changed files
with
4,947 additions
and
1,274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Package { #name : 'BaselineOfGitLabHealth' } | ||
Package { #name : #BaselineOfGitLabHealth } |
72 changes: 72 additions & 0 deletions
72
src/GitLabHealth-Model-Analysis-Tests/ClosedMergeRequestMetricTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
" | ||
A ClosedMergeRequestMetricTest is a test class for testing the behavior of ClosedMergeRequestMetric | ||
" | ||
Class { | ||
#name : #ClosedMergeRequestMetricTest, | ||
#superclass : #TestCase, | ||
#category : #'GitLabHealth-Model-Analysis-Tests' | ||
} | ||
|
||
{ #category : #tests } | ||
ClosedMergeRequestMetricTest >> testCalculate [ | ||
|
||
| result glhImporter user closedMergeRequestMetric | | ||
"Given" | ||
user := GLHUser new | ||
username: 'test'; | ||
contributedProjects: | ||
{ (GLHProject new repository: GLHRepository new) }. | ||
|
||
glhImporter := GLPHImporterMock new. | ||
glhImporter mergeRequests: { | ||
(GLPHEMergeRequest new | ||
author: user; | ||
created_at: '09-05-2024'; | ||
merged_at: '09-05-2024'; | ||
state: 'closed'). | ||
(GLPHEMergeRequest new | ||
author: user; | ||
created_at: '09-05-2024'; | ||
merged_at: nil; | ||
state: 'closed') }. | ||
|
||
|
||
closedMergeRequestMetric := ClosedMergeRequestMetric new | ||
user: user; | ||
glhImporter: glhImporter; | ||
setPeriodSince: '09-04-2024' | ||
until: '09-04-2024'; | ||
over: Week. | ||
|
||
"When" | ||
result := closedMergeRequestMetric calculate. | ||
|
||
"Then" | ||
self assert: result equals: 1 | ||
] | ||
|
||
{ #category : #tests } | ||
ClosedMergeRequestMetricTest >> testCalculateNoMergeRequests [ | ||
|
||
| result glhImporter user closedMergeRequestMetric | | ||
"Given" | ||
user := GLHUser new | ||
username: 'test'; | ||
contributedProjects: | ||
{ (GLHProject new repository: GLHRepository new) }. | ||
|
||
glhImporter := GLPHImporterMock new. | ||
|
||
closedMergeRequestMetric := ClosedMergeRequestMetric new | ||
user: user; | ||
glhImporter: glhImporter; | ||
setPeriodSince: '09-04-2024' | ||
until: '09-04-2024'; | ||
over: Week. | ||
|
||
"When" | ||
result := closedMergeRequestMetric calculate. | ||
|
||
"Then" | ||
self assert: result equals: 0 | ||
] |
42 changes: 42 additions & 0 deletions
42
src/GitLabHealth-Model-Analysis-Tests/ClosedTicketsMetricTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
" | ||
A ClosedTicketsMetricTest is a test class for testing the behavior of ClosedTicketsMetric | ||
" | ||
Class { | ||
#name : #ClosedTicketsMetricTest, | ||
#superclass : #TestCase, | ||
#category : #'GitLabHealth-Model-Analysis-Tests' | ||
} | ||
|
||
{ #category : #tests } | ||
ClosedTicketsMetricTest >> testCalculate [ | ||
|
||
| result glhImporter user closedTicket jiraImporter | | ||
"Given" | ||
user := GLHUser new | ||
username: 'test'; | ||
contributedProjects: | ||
{ (GLHProject new repository: GLHRepository new) }. | ||
|
||
glhImporter := GLPHImporterMock new. | ||
glhImporter mergeRequests: { (GLPHEMergeRequest new | ||
author: user; | ||
created_at: '09-05-2024'; | ||
title: '205 feat do something') }. | ||
|
||
jiraImporter := JiraImporterMock new. | ||
jiraImporter issues: { (JPIssue new key: '205') }. | ||
|
||
|
||
closedTicket := ClosedTicketsMetric new | ||
user: user; | ||
glhImporter: glhImporter; | ||
jiraImporter: jiraImporter; | ||
setPeriodSince: '09-04-2024' until: '09-04-2024'; | ||
over: Week. | ||
|
||
"When" | ||
result := closedTicket calculate. | ||
|
||
"Then" | ||
self assert: result equals: 1 | ||
] |
Oops, something went wrong.