mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Truncating TvDb Overviews actually works. Stupid Recaps.
This commit is contained in:
parent
3a992a8d0c
commit
399b50ec8e
5 changed files with 55 additions and 46 deletions
|
@ -191,5 +191,33 @@ namespace NzbDrone.Core.Test
|
|||
//Resolve
|
||||
result.Should().Be(10);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Truncate_should_truncate_strings_to_max_specified_number_of_bytes()
|
||||
{
|
||||
//Setup
|
||||
var str = File.ReadAllText(@"Files\LongOverview.txt");
|
||||
|
||||
//Act
|
||||
var resultString = str.Truncate(1000);
|
||||
|
||||
//Resolve
|
||||
var result = new System.Text.UTF8Encoding().GetBytes(resultString);
|
||||
result.Length.Should().BeLessOrEqualTo(1000);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Truncate_should_not_truncate_string_shorter_than_max_bytes()
|
||||
{
|
||||
//Setup
|
||||
var str = "Hello World";
|
||||
|
||||
//Act
|
||||
var resultString = str.Truncate(1000);
|
||||
|
||||
//Resolve
|
||||
var result = new System.Text.UTF8Encoding().GetBytes(resultString);
|
||||
result.Length.Should().Be(11);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue