Skip to content

Instantly share code, notes, and snippets.

@pragmatrix
Created November 14, 2012 17:02
Show Gist options
  • Save pragmatrix/4073330 to your computer and use it in GitHub Desktop.
Save pragmatrix/4073330 to your computer and use it in GitHub Desktop.
public interface ISet<ItemT>
{
void Add(ItemT item);
void Remove(ItemT item);
bool Contains(ItemT item);
IEnumerable<ItemT> Items { get; }
int Count { get; }
}
public sealed class ISet<ItemT>
{
public Action<ItemT> Add = delegate { };
public Action<ItemT> Remove = delegate { };
public Func<ItemT, bool> Contains = delegate { return false; };
public Func<IEnumerable<ItemT>> Items = () => Enumerable.Empty<ItemT>();
public Func<int> Count = () => 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment