예제 #1
0
        public void GetFunctionParameterInfo()
        {
            FunctionBaseTest_Function function = new FunctionBaseTest_Function(null);
            var paraInfo = function.GetFunctionParameterInfoAsync(base.ServiceCollection.BuildServiceProvider(), false).GetAwaiter().GetResult();

            Assert.AreEqual(3, paraInfo.Count);

            Assert.AreEqual("Path", paraInfo[0].Name);
            Assert.AreEqual("路径", paraInfo[0].Title);
            Assert.AreEqual("本地物理路径,如:E:\\Senparc\\Scf\\", paraInfo[0].Description);
            Assert.AreEqual(true, paraInfo[0].IsRequired);
            Assert.AreEqual("String", paraInfo[0].SystemType);
            Assert.AreEqual(ParameterType.Text, paraInfo[0].ParameterType);

            Assert.AreEqual("NewNamespace", paraInfo[1].Name);
            Assert.AreEqual("新命名空间", paraInfo[1].Title);
            Assert.AreEqual(ParameterType.Text, paraInfo[1].ParameterType);
            Assert.AreEqual("命名空间根,必须以.结尾,用于替换[Senparc.Scf.]", paraInfo[1].Description);

            Assert.AreEqual(ParameterType.DropDownList, paraInfo[2].ParameterType);
            Assert.AreEqual("Site", paraInfo[2].Name);
            Assert.AreEqual("网站", paraInfo[2].Title);
            Assert.AreEqual("选择需要下载的网站", paraInfo[2].Description);
            Assert.AreEqual(3, paraInfo[2].SelectionList.Items.Count());
            Assert.AreEqual("请选择", paraInfo[2].SelectionList.Items[0].Text);
            Assert.AreEqual("GitHub", paraInfo[2].SelectionList.Items[1].Value);
            Assert.AreEqual("Gitee", paraInfo[2].SelectionList.Items[2].Value);
        }
예제 #2
0
        public void GetFunctionParammeterInfo()
        {
            FunctionBaseTest_Function function = new FunctionBaseTest_Function(null);
            var paraInfo = function.GetFunctionParammeterInfo().ToList();

            Assert.AreEqual(3, paraInfo.Count);

            Assert.AreEqual("Path", paraInfo[0].Name);
            Assert.AreEqual("路径", paraInfo[0].Title);
            Assert.AreEqual("本地物理路径,如:E:\\Senparc\\Scf\\", paraInfo[0].Description);
            Assert.AreEqual(true, paraInfo[0].IsRequired);
            Assert.AreEqual("String", paraInfo[0].SystemType);
            Assert.AreEqual(ParammeterType.Text, paraInfo[0].ParammeterType);

            Assert.AreEqual("NewNamespace", paraInfo[1].Name);
            Assert.AreEqual("新命名空间", paraInfo[1].Title);
            Assert.AreEqual(ParammeterType.Text, paraInfo[1].ParammeterType);
            Assert.AreEqual("命名空间根,必须以.结尾,用于替换[Senparc.Scf.]", paraInfo[1].Description);

            Assert.AreEqual(ParammeterType.SingleSelection, paraInfo[2].ParammeterType);
            Assert.AreEqual("Site", paraInfo[2].Name);
            Assert.AreEqual("网站", paraInfo[2].Title);
            Assert.AreEqual("选择需要下载的网站", paraInfo[2].Description);
            Assert.AreEqual(3, paraInfo[2].SelectionItems.Count());
            Assert.AreEqual("", paraInfo[2].SelectionItems[0]);
            Assert.AreEqual("GitHub", paraInfo[2].SelectionItems[1]);
            Assert.AreEqual("Gitee", paraInfo[2].SelectionItems[2]);
        }