-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor and unit test for ToSnakeCase extension method (#42)
* Refactor and unit test for ToSnakeCase extension method * Code cleanup * Lock contention assertion should be GreaterThanOrEqualTo instead of EqualTo
- Loading branch information
1 parent
15fb9b4
commit 3507cb8
Showing
8 changed files
with
30 additions
and
29 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
17 changes: 17 additions & 0 deletions
17
src/prometheus-net.DotNetRuntime.Tests/StatsCollectors/Util/StringExtensionsTests.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,17 @@ | ||
using NUnit.Framework; | ||
using Prometheus.DotNetRuntime.StatsCollectors.Util; | ||
|
||
namespace Prometheus.DotNetRuntime.Tests.StatsCollectors.Util | ||
{ | ||
public class StringExtensionsTests | ||
{ | ||
[TestCase("", "")] | ||
[TestCase("myGreatVariableName", "my_great_variable_name")] | ||
[TestCase("my_great_variable_name", "my_great_variable_name")] | ||
[TestCase("MyGreatVariableName", "my_great_variable_name")] | ||
public void ToSnakeCase_Should_Convert_To_Snake_Case(string given, string expected) | ||
{ | ||
Assert.AreEqual(given.ToSnakeCase(), expected); | ||
} | ||
} | ||
} |
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
1 change: 0 additions & 1 deletion
1
src/prometheus-net.DotNetRuntime/StatsCollectors/Util/EventPairTimer.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
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
1 change: 0 additions & 1 deletion
1
src/prometheus-net.DotNetRuntime/StatsCollectors/Util/SamplingRate.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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
using System; | ||
using System.Threading; | ||
|
||
namespace Prometheus.DotNetRuntime.StatsCollectors.Util | ||
|
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