mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
finish batch of AddIfNotNullOrEmptyShould tests
This commit is contained in:
parent
5c5e3a085c
commit
5dda4c8e03
1 changed files with 24 additions and 4 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using FilterLists.Services.Extensions;
|
||||
using Xunit;
|
||||
|
|
@ -6,15 +7,34 @@ namespace FilterLists.Services.Tests.Extensions
|
|||
{
|
||||
public class AddIfNotNullOrEmptyShould
|
||||
{
|
||||
public AddIfNotNullOrEmptyShould() =>
|
||||
sut = new Collection<string>();
|
||||
|
||||
private readonly ICollection<string> sut;
|
||||
private string item;
|
||||
|
||||
[Fact]
|
||||
public void AddIfNotNullOrEmpty()
|
||||
{
|
||||
var sut = new Collection<string>();
|
||||
const string item = "item";
|
||||
|
||||
item = "item";
|
||||
sut.AddIfNotNullOrEmpty(item);
|
||||
|
||||
Assert.Contains(item, sut);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NotAddIfEmpty()
|
||||
{
|
||||
item = "";
|
||||
sut.AddIfNotNullOrEmpty(item);
|
||||
Assert.DoesNotContain(item, sut);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NotAddIfNull()
|
||||
{
|
||||
item = null;
|
||||
sut.AddIfNotNullOrEmpty(item);
|
||||
Assert.DoesNotContain(item, sut);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue