Example #1
0
 public static void AssertEquality <T>(this TableRow row, T record)
 {
     foreach (var header in FixtureMapping.Headers <T>())
     {
         var cell = GetCellByHeader(row, header);
         cell.AssertEquality(record, header);
     }
 }
Example #2
0
 public static bool IsEqualTo <T>(this TableRow row, T recordBase)
 {
     foreach (var header in FixtureMapping.Headers <T>())
     {
         var cell = GetCellByHeader(row, header);
         if (!cell.IsEqual(recordBase, header))
         {
             return(false);
         }
     }
     return(true);
 }
Example #3
0
        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));
            }
        }
Example #4
0
        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());
        }