Beispiel #1
0
        public async void TestReturnType()
        {
            var retTest = WebApiExecutionGenerator.Create <IReturnTypeTest>();

            var a0 = retTest.RetBool();
            var a1 = retTest.RetByte();
            var a2 = retTest.RetChar();
            var a3 = retTest.RetDateTime();
            var a4 = retTest.RetDecimal();
            var a5 = retTest.RetDouble();
            var a6 = retTest.RetShort();
            var a7 = retTest.RetInt();
            var a8 = retTest.RetLong();
            var a9 = retTest.RetString();

            var b0 = await retTest.RetBoolAsync();

            var b1 = await retTest.RetByteAsync();

            var b2 = await retTest.RetCharAsync();

            var b3 = await retTest.RetDateTimeAsync();

            var b4 = await retTest.RetDecimalAsync();

            var b5 = await retTest.RetDoubleAsync();

            var b6 = await retTest.RetShortAsync();

            var b7 = await retTest.RetIntAsync();

            var b8 = await retTest.RetLongAsync();

            var b9 = await retTest.RetStringAsync();
        }
Beispiel #2
0
        public void TestToBodyForm1()
        {
            var argTest = WebApiExecutionGenerator.Create <IArgumentTest>();
            var a1      = new Student {
                Name = "test", Age = 12
            };

            argTest.TestFormRequest1(a1);
        }
Beispiel #3
0
        public async Task Test1Async()
        {
            var md = typeof(TestClass).GetMethods(BindingFlags.NonPublic | BindingFlags.Instance).Where(m => m.Name == "InvokeAsync" && m.ReturnType == typeof(Task <>));//.FirstOrDefault();
            //var m = typeof(TestClass).GetMethod("InvokeAsync", BindingFlags.Instance | BindingFlags.NonPublic, null, CallingConventions.Any, new Type[] { typeof(MethodInfo), typeof(object[]) }, null);
            //m.Invoke(new TestClass(), new object[] { null, null });

            //var response1 = await WebApiExecutionGenerator<ITest>.Create().TestFullUrlAsync();

            var response = WebApiExecutionGenerator.Create <ITest>().TestFullUrl();

            Console.WriteLine(response);
            Assert.False(string.IsNullOrEmpty(response));
        }
Beispiel #4
0
        public void TestToBodyForm2()
        {
            var argTest = WebApiExecutionGenerator.Create <IArgumentTest>();

            argTest.TestFormRequest2("foo");
        }