public void GivenAddingATableOfValuesToTheListL(Table table)
        {
            var list = ScenarioContext.Current.Get <IList <object> >(KeyList);

            foreach (var row in table.Rows)
            {
                var columns = row.Values;
                var type    = columns.ElementAt(0);
                var value   = columns.ElementAt(1);
                list.Add(TckUtil.GetValue(type, value));
            }
        }
        public void GivenAddingATableOfValuesToTheMapM(Table table)
        {
            var i   = 0;
            var map = ScenarioContext.Current.Get <IDictionary <string, object> >(Keymap);

            foreach (var row in table.Rows)
            {
                var columns = row.Values;
                var type    = columns.ElementAt(0);
                var value   = columns.ElementAt(1);
                map.Add($"Key{i++}", TckUtil.GetValue(type, value));
            }
        }
Exemplo n.º 3
0
        public void GivenAMapOfSizeAndTypeNull(int size, string type)
        {
            string value;

            switch (type)
            {
            case "Null":
                value = "null";
                break;

            case "Boolean":
                value = "true";
                break;

            case "Integer":
                value = "10";
                break;

            case "Float":
                value = "10.10";
                break;

            case "String":
                value = "lalalalalala";
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, $"Unknown type {type}");
            }
            var itemInMap = TckUtil.GetValue(type, value);
            var dict      = new Dictionary <string, object>();

            for (var i = 0; i < size; i++)
            {
                dict.Add("Key" + i, itemInMap);
            }
            ScenarioContext.Current.Set(dict,
                                        DriverTypesTestEchoingSingleParameterSteps.KeyExpected);
        }
 public void GivenAValueOfType(string value, string type)
 {
     ScenarioContext.Current.Set(TckUtil.GetValue(type, value), KeyExpected);
 }
        private List <object> GetList(string type, string values)
        {
            var strings = values.Split(new[] { ",", "[", "]" }, StringSplitOptions.RemoveEmptyEntries);

            return(strings.Select(value => TckUtil.GetValue(type, value)).ToList());
        }