-
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.
Define a first unit test for FileHelper
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import static org.junit.Assert.* | ||
import org.junit.Test | ||
|
||
class FileHelperTest { | ||
@Test | ||
void testStandardizeVersionForSemVer() { | ||
FileHelper fileHelper = new FileHelper() | ||
|
||
// Test case 1: Standard version without label | ||
String result1 = fileHelper.standarizeVersionForSemVer("1.3.5", "88", "") | ||
assertEquals("1.3.88", result1) | ||
|
||
// Test case 2: Version with 'beta' label | ||
String result2 = fileHelper.standarizeVersionForSemVer("2.1.5", "457", "beta") | ||
assertEquals("2.1.0-beta.457", result2) | ||
|
||
// Test case 3: Increase major version by 100 without label | ||
String result3 = fileHelper.standarizeVersionForSemVer("1.3.5", "88", "", 100) | ||
assertEquals("101.3.88", result3) | ||
} | ||
} |