-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the version comparation error for pre-releases in CodeGen tool (#…
- Loading branch information
1 parent
f3c00df
commit fbe60a1
Showing
2 changed files
with
32 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
22 changes: 22 additions & 0 deletions
22
src/HassModel/NetDaemon.HassModel.Tests/CodeGenerator/DependencyValidatorTests.cs
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,22 @@ | ||
using NetDaemon.HassModel.CodeGenerator; | ||
|
||
namespace NetDaemon.HassModel.Tests.CodeGenerator; | ||
|
||
public class DependencyValidatorTests | ||
{ | ||
// Test that pre-release versions are trimmed using the TrimPreReleaseVersion method using theory | ||
[Theory] | ||
[InlineData("1.0.0-alpha", "1.0.0")] | ||
[InlineData("24.17.0-alpha-2", "24.17.0")] | ||
[InlineData("24.17.0", "24.17.0")] | ||
public void TrimPreReleaseVersionShouldReturnCorrectVersion(string version, string expected) | ||
{ | ||
// ARRANGE | ||
|
||
// ACT | ||
var result = DependencyValidator.TrimPreReleaseVersion(version); | ||
|
||
// ASSERT | ||
result.Should().Be(expected); | ||
} | ||
} |