コード例 #1
0
        /// <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);
        }
コード例 #2
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));
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
        /// <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);
        }
コード例 #6
0
        /// <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 = null;

            estateDetails = this.Estates.SingleOrDefault(e => e.EstateName == estateName);

            if (estateDetails == null && estateName == "InvalidEstate")
            {
                estateDetails = EstateDetails.Create(Guid.Parse("79902550-64DF-4491-B0C1-4E78943928A3"), estateName);
                estateDetails.AddMerchant(Guid.Parse("36AA0109-E2E3-4049-9575-F507A887BB1F"), "Test Merchant 1");
                this.Estates.Add(estateDetails);
            }

            estateDetails.ShouldNotBeNull();

            return(estateDetails);
        }