Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
/packages/
riderModule.iml
/_ReSharper.Caches/
.idea
.idea
# BenchmarkDotNet output
BenchmarkDotNet.Artifacts/
38 changes: 23 additions & 15 deletions Benchmarks/Benchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
BenchmarkRunner.Run<StringExtensionBenchmark>(
ManualConfig.Create(DefaultConfig.Instance.WithOptions(ConfigOptions.DisableOptimizationsValidator)));


namespace Benchmark {

namespace Benchmark
{
/// <summary>
/// Contains benchmarks for the StringExtension methods.
/// </summary>
[MemoryDiagnoser(false)]
public class StringExtensionBenchmark {

public class StringExtensionBenchmark
{
private readonly string input = "hello world!";
private readonly char[] charactersToRemove = { 'l', 'o' };
private readonly string substring = "l";
Expand All @@ -26,72 +25,81 @@ public class StringExtensionBenchmark {
/// Benchmark for the RemoveCharacters method.
/// </summary>
[Benchmark]
public string RemoveCharacters() {
public string RemoveCharacters()
{
return input.RemoveCharacters(charactersToRemove);
}

/// <summary>
/// Benchmark for the IsValidEmail method.
/// </summary>
[Benchmark]
public bool IsValidEmail() {
public bool IsValidEmail()
{
return email.IsValidEmail();
}

/// <summary>
/// Benchmark for the IsValidPhoneNumber method.
/// </summary>
[Benchmark]
public bool IsValidPhoneNumber() {
public bool IsValidPhoneNumber()
{
return phoneNumber.IsValidPhoneNumber();
}

/// <summary>
/// Benchmark for the CountSubstring method.
/// </summary>
[Benchmark]
public int CountSubstring() {
public int CountSubstring()
{
return input.CountSubstring(substring);
}

/// <summary>
/// Benchmark for the ReverseWords method.
/// </summary>
[Benchmark]
public string ReverseWords() {
public string ReverseWords()
{
return input.ReverseWords();
}

/// <summary>
/// Benchmark for the IsPalindrome method.
/// </summary>
[Benchmark]
public bool IsPalindrome() {
public bool IsPalindrome()
{
return input.IsPalindrome();
}

/// <summary>
/// Benchmark for the CountLetters method.
/// </summary>
[Benchmark]
public int CountLetters() {
public int CountLetters()
{
return input.CountLetters();
}

/// <summary>
/// Benchmark for the RemoveDuplicateCharacters method.
/// </summary>
[Benchmark]
public string RemoveDuplicateCharacters() {
public string RemoveDuplicateCharacters()
{
return input.RemoveDuplicateCharacters();
}

/// <summary>
/// Benchmark for the ConvertToCamelCase method.
/// </summary>
[Benchmark]
public string ConvertToCamelCase() {
public string ConvertToCamelCase()
{
return input.ToCamelCase();
}
}
}
}
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ Install [StringExtension](https://www.nuget.org/packages/String-Extension/) usin


## Running Tests
- The unit tests are [here](https://github.com/Antyss77/StringExtension/blob/master/UnitTests/UnitTest.cs)
- The unit tests are [here](https://github.com/Antyss77/StringExtension/blob/master/UnitTests/StringExtensionTests.cs)
- The performance tests are [here](https://github.com/Antyss77/StringExtension/blob/master/Benchmarks/Benchmark.cs)

## Licence
Distributed under the MIT License. See [LICENCE](https://github.com/Antyss77/StringExtension/blob/master/LICENSE) for more information.

## Contributing
You can contribute to the project in several ways: by proposing new ideas, reporting bugs you encounter, or improving existing code. If you would like to submit a change, you can open a Pull Request so that we can review your changes and incorporate them into the project if necessary. We welcome your participation and look forward to moving this string library project forward.


You can contribute to the project in several ways: by proposing new ideas, reporting bugs you encounter, or improving existing code. If you would like to submit a change, you can open a Pull Request so that we can review your changes and incorporate them into the project if necessary. We welcome your participation and look forward to moving this string library project forward.
28 changes: 0 additions & 28 deletions StringExtension.sln

This file was deleted.

5 changes: 5 additions & 0 deletions StringExtension.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Solution>
<Project Path="Benchmarks/Benchmarks.csproj" />
<Project Path="StringExtension/StringExtension.csproj" />
<Project Path="UnitTests/UnitTests.csproj" />
</Solution>
Loading
Loading