コード例 #1
0
        /// <summary>
        /// Gets the enum value.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="row">The row.</param>
        /// <param name="key">The key.</param>
        /// <returns></returns>
        public static T GetEnumValue <T>(TableRow row,
                                         String key) where T : struct
        {
            String field = SpecflowTableHelper.GetStringRowValue(row, key);

            return(Enum.Parse <T>(field, true));
        }
コード例 #2
0
        public static Int32 GetIntValue(TableRow row,
                                        String key)
        {
            String field = SpecflowTableHelper.GetStringRowValue(row, key);

            return(Int32.TryParse(field, out Int32 value) ? value : -1);
        }
コード例 #3
0
        public static Boolean GetBooleanValue(TableRow row,
                                              String key)
        {
            String field = SpecflowTableHelper.GetStringRowValue(row, key);

            return(Boolean.TryParse(field, out Boolean value) && value);
        }
コード例 #4
0
        public static Decimal GetDecimalValue(TableRow row,
                                              String key)
        {
            String field = SpecflowTableHelper.GetStringRowValue(row, key);

            return(Decimal.TryParse(field, out Decimal value) ? value : -1);
        }
コード例 #5
0
        public EstateDetails GetEstateDetails(TableRow tableRow)
        {
            String estateName = SpecflowTableHelper.GetStringRowValue(tableRow, "EstateName");

            EstateDetails estateDetails = this.GetEstateDetails(estateName);

            return(estateDetails);
        }
コード例 #6
0
        public static Int16 GetShortValue(TableRow row,
                                          String key)
        {
            String field = SpecflowTableHelper.GetStringRowValue(row, key);

            if (Int16.TryParse(field, out Int16 value))
            {
                return(value);
            }
            else
            {
                return(-1);
            }
        }