I have the following class:
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;
}
}
In English grammar, you cannot “equal something” or “do something more than something,” so I don’t want Is.EqualTo and Do.GreaterThan to be possible. Is there any way to limit it?
var f = new Fluently();
f.Is("a").GreaterThan("b");
f.Is("a").EqualTo("b");
f.Does("a").GreaterThan("b");
f.Does("a").EqualTo("b");
Thanks!
source
share