mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Added tests for null list in Min/Max or Default
This commit is contained in:
parent
a42d90f22c
commit
a087c89903
2 changed files with 30 additions and 1 deletions
|
@ -192,6 +192,19 @@ namespace NzbDrone.Core.Test
|
|||
result.Should().Be(10);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MaxOrDefault_should_return_zero_when_collection_is_null()
|
||||
{
|
||||
//Setup
|
||||
List<int> list = null;
|
||||
|
||||
//Act
|
||||
var result = list.MaxOrDefault();
|
||||
|
||||
//Resolve
|
||||
result.Should().Be(0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Truncate_should_truncate_strings_to_max_specified_number_of_bytes()
|
||||
{
|
||||
|
@ -234,7 +247,7 @@ namespace NzbDrone.Core.Test
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void MinOrDefault_should_return_max_when_collection_is_not_empty()
|
||||
public void MinOrDefault_should_return_min_when_collection_is_not_empty()
|
||||
{
|
||||
//Setup
|
||||
var list = new List<int> { 6, 4, 5, 3, 8, 10 };
|
||||
|
@ -245,5 +258,18 @@ namespace NzbDrone.Core.Test
|
|||
//Resolve
|
||||
result.Should().Be(3);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MinOrDefault_should_return_zero_when_collection_is_null()
|
||||
{
|
||||
//Setup
|
||||
List<int> list = null;
|
||||
|
||||
//Act
|
||||
var result = list.MinOrDefault();
|
||||
|
||||
//Resolve
|
||||
result.Should().Be(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue