I think you want something like it:
// VS Unit Testing Framework
Assert.IsTrue(actual.Alpha == expected.Alpha, "the Alpha objects are not equals");
Assert.IsTrue(actual.Beta == expected.Beta, "the Beta objects are not equals");
// Fluent Assertion
actual.Alpha.Should().Be(expected.Alpha);
actual.Beta.Should().Be(expected.Beta);
Also, if you want to compare lists of objects
// Helper method to compare - VS Unit Testing Framework
private static void CompareIEnumerable<T>(IEnumerable<T> one, IEnumerable<T> two, Func<T, T, bool> comparisonFunction)
{
var oneArray = one as T[] ?? one.ToArray();
var twoArray = two as T[] ?? two.ToArray();
if (oneArray.Length != twoArray.Length)
{
Assert.Fail("Collections have not same length");
}
for (int i = 0; i < oneArray.Length; i++)
{
var isEqual = comparisonFunction(oneArray[i], twoArray[i]);
Assert.IsTrue(isEqual);
}
}
public void HowToCall()
{
// How you need to call the comparer helper:
CompareIEnumerable(actual, expected, (x, y) =>
x.Alpha == y.Alpha &&
x.Beta == y.Beta );
}