int a, b, c, d, e;
a = b = c = d = e = 1;
if ((a==b) && (b==c) && (c==d) && (d==e))
{
Console.WriteLine("that syntax is horrible");
}
is there a more elegant way to test multiple equality as above?
maybe an AreEqual(params obj[]) or something? I had a google but didn’t find anything.
A possible implementation of
AreEqual(params object[] objects):(Following Jon Skeet’s advice, here’s a generic version)
The
Skip(1)is not strictly necessary either.