/// <summary> /// Gets the decimal value. /// </summary> /// <param name="row">The row.</param> /// <param name="key">The key.</param> /// <returns></returns> public static Decimal GetDecimalValue(TableRow row, String key) { String field = SpecflowTableHelper.GetStringRowValue(row, key); return(decimal.TryParse(field, out Decimal value) ? value : -1); }
/// <summary> /// Gets the int value. /// </summary> /// <param name="row">The row.</param> /// <param name="key">The key.</param> /// <returns></returns> public static Int32 GetIntValue(TableRow row, String key) { String field = SpecflowTableHelper.GetStringRowValue(row, key); return(int.TryParse(field, out Int32 value) ? value : -1); }
/// <summary> /// Gets the boolean value. /// </summary> /// <param name="row">The row.</param> /// <param name="key">The key.</param> /// <returns></returns> public static Boolean GetBooleanValue(TableRow row, String key) { String field = SpecflowTableHelper.GetStringRowValue(row, key); return(bool.TryParse(field, out Boolean value) && value); }
/// <summary> /// Gets the estate details. /// </summary> /// <param name="tableRow">The table row.</param> /// <returns></returns> public EstateDetails GetEstateDetails(TableRow tableRow) { String estateName = SpecflowTableHelper.GetStringRowValue(tableRow, "EstateName"); EstateDetails estateDetails = this.Estates.SingleOrDefault(e => e.EstateName == estateName); estateDetails.ShouldNotBeNull(); return(estateDetails); }
/// <summary> /// Gets the short value. /// </summary> /// <param name="row">The row.</param> /// <param name="key">The key.</param> /// <returns></returns> public static Int16 GetShortValue(TableRow row, String key) { String field = SpecflowTableHelper.GetStringRowValue(row, key); if (short.TryParse(field, out Int16 value)) { return(value); } return(-1); }