public static void AssertEquality <T>(this TableCell cell, T record, string alias) { var value = FixtureMapping.GetValue(record, alias); var compare = value as Func <Element, bool>; if (compare != null) { Assert.That(compare(cell.Elements.First()), Is.True, "Для ячейки {0} не нашлось значения {1} по алиасу {2}", cell, record, alias); } else { Assert.That(cell.Text != null ? cell.Text.Trim() : cell.Text, Is.EqualTo(value)); } }
public static bool IsEqual <T>(this TableCell cell, T record, string alias) { var value = FixtureMapping.GetValue(record, alias); var compare = value as Func <Element, bool>; if (compare != null) { return(compare(cell.Elements.First())); } if (value == null) { return(cell.Text == null); } return((cell.Text != null ? cell.Text.Trim() : cell.Text) == value.ToString()); }