|
using System.Collections.Generic;
using Nelibur.Sword.Extensions;
using Xunit;
namespace UnitTests.Nelibur.Sword.Extensions
{
public sealed class CollectionExtensionsTests
{
[Fact]
public void IsEmpty_Empty_True()
{
bool result = new List<int>().IsEmpty();
Assert.True(result);
}
[Fact]
public void IsNotEmpty_NotEmpty_True()
{
bool result = new List<int> { 1 }.IsNotEmpty();
Assert.True(result);
}
[Fact]
public void IsNullOrEmptyNull_Null_True()
{
bool result = ((ICollection<int>)null).IsNullOrEmpty();
Assert.True(result);
}
[Fact]
public void IsNullOrEmpty_Empty_True()
{
bool result = new List<int>().IsNullOrEmpty();
Assert.True(result);
}
[Fact]
public void IsNullOrEmpty_NotEmpty_False()
{
bool result = new List<int> { 1 }.IsNullOrEmpty();
Assert.False(result);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
B.Sc. in Computer Science.