You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
644 B
27 lines
644 B
2 years ago
|
using Recyclarr.Common.Extensions;
|
||
3 years ago
|
|
||
1 year ago
|
namespace Recyclarr.Tests.Common.Extensions;
|
||
3 years ago
|
|
||
|
[TestFixture]
|
||
|
public class StringExtensionsTest
|
||
|
{
|
||
|
[Test]
|
||
|
public void Carriage_returns_and_newlines_are_stripped_from_front_and_back()
|
||
|
{
|
||
|
"\r\ntest\n\r".TrimNewlines().Should().Be("test");
|
||
|
}
|
||
|
|
||
|
[Test]
|
||
|
public void Spaces_are_ignored_when_stripping_newlines()
|
||
|
{
|
||
|
"\n test \r".TrimNewlines().Should().Be(" test ");
|
||
|
}
|
||
1 year ago
|
|
||
|
[Test]
|
||
|
public void Snake_case_works()
|
||
|
{
|
||
|
"UpperCamelCase".ToSnakeCase().Should().Be("upper_camel_case");
|
||
|
"lowerCamelCase".ToSnakeCase().Should().Be("lower_camel_case");
|
||
|
}
|
||
3 years ago
|
}
|