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
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,29 @@ public class IsListNotNullOrEmptyConverterTests : BaseOneWayConverterTest<IsList
{
new List<string>(), false
},
{
Array.Empty<string>(), false
},
{
new List<string>
{
"TestValue"
},
true
},
{
new []
{
"TestValue"
},
true
},
{
null, false
},
{
Enumerable.Range(1, 3), true
},
}
};

[Theory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,29 @@ public class IsListNullOrEmptyConverterTests : BaseOneWayConverterTest<IsListNul
{
new List<string>(), true
},
{
Array.Empty<string>(), true
},
{
new List<string>
{
"TestValue"
},
false
},
{
new []
{
"TestValue"
},
false
},
{
null, true
},
{
Enumerable.Range(1, 3), false
},
}
};

[Theory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ internal static bool IsListNullOrEmpty(IEnumerable? value)
var enumerator = value.GetEnumerator();
bool result = !enumerator.MoveNext();

((IDisposable)enumerator).Dispose();
if (enumerator is IDisposable disposable)
{
disposable.Dispose();
}

return result;
}
}
Loading