mirror of https://github.com/ogoun/Zero.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
475 B
22 lines
475 B
using System;
|
|
|
|
namespace ZeroLevel.Specification
|
|
{
|
|
public class CurrySpecification<T, R> : BaseSpecification<T>
|
|
{
|
|
private readonly Func<T, R> _selector;
|
|
private readonly R _value;
|
|
|
|
public CurrySpecification(Func<T, R> selector, R val)
|
|
{
|
|
_selector = selector;
|
|
_value = val;
|
|
}
|
|
|
|
public override bool IsSatisfiedBy(T o)
|
|
{
|
|
return _selector(o).Equals(_value);
|
|
}
|
|
}
|
|
}
|