public void AddParameter_StringType(Type type)
        {
            SPSSchema schema = new SPSSchema();

            schema.AddParameter(type.ToString(), type.ToString());
            Assert.IsTrue(schema.Schema.Count == 1);
            Trace.WriteLine(string.Format("{0},{1},{2}", type, schema.Schema[0].Name, schema.Schema[0].PropertyType));
            Assert.IsTrue(schema.Schema[0].Name == type.ToString());
            Assert.IsTrue(schema.Schema[0].PropertyType.Equals(type));
        }
        /// <summary>
        /// Gets the Schema.
        /// </summary>
        /// <returns>
        /// Describing the variables in the query
        /// </returns>
        public PropertyDescriptorCollection GetSchema()
        {
            SPSSchema schema = new SPSSchema();

            foreach (SPSKeyValuePair keyValuePair in _variableFunctions)
            {
                schema.AddParameter(keyValuePair.Key, typeof(string));
            }

            return(schema.Schema);
        }
        //#region Public properties

        ///// <summary>
        ///// Gets the variables values.
        ///// </summary>
        ///// <value>The variables values.</value>
        //public SPSKeyValueList VariablesValues
        //{
        //    get { return _variableValues; }
        //}

        //#endregion

        #region Public methods

        /// <summary>
        /// Gets the Schema.
        /// </summary>
        /// <returns>
        /// Describing the variables in the query
        /// </returns>
        public PropertyDescriptorCollection GetSchema()
        {
            ParseParametersFormulas();

            SPSSchema schema = new SPSSchema();

            foreach (SPSKeyValuePair keyValuePair in _parameterFormulas)
            {
                schema.AddParameter(keyValuePair.Key, typeof(string));
            }

            return(schema.Schema);
        }
Beispiel #4
0
 public SPSParametersProvider_Tests()
 {
     schema = new SPSSchema();
     schema.AddParameter("Test1", typeof(string));
     schema.AddParameter("Test2", typeof(int));
 }