私は次のクラスを持っています:
public class Fluently
{
public Fluently Is(string lhs)
{
return this;
}
public Fluently Does(string lhs)
{
return this;
}
public Fluently EqualTo(string rhs)
{
return this;
}
public Fluently LessThan(string rhs)
{
return this;
}
public Fluently GreaterThan(string rhs)
{
return this;
}
}
英語の文法では、「is something equal to something」または「does something greater than something」を使用できないため、Is.EqualTo と Does.GreaterThan を可能にしたくありません。制限する方法はありますか?
var f = new Fluently();
f.Is("a").GreaterThan("b");
f.Is("a").EqualTo("b"); //grammatically incorrect in English
f.Does("a").GreaterThan("b");
f.Does("a").EqualTo("b"); //grammatically incorrect in English
ありがとうございました!