Beispiel #1
0
        public void TestMethod_Standalone()
        {
            bool b = IsPrime(10111);

            Assert.IsTrue(b);
            FeignClients.AddFeignClients(options =>
            {
                options.Assemblies.Add(typeof(ITestService).Assembly);
                options.FeignClientPipeline.ReceivingQueryResult();
            });
            ITestService testService = FeignClients.Get <ITestService>();

            Assert.IsNotNull(testService);

            FilePathRequestFile filePathRequestFile = new FilePathRequestFile(@"E:\asdasdasd.txt");

            filePathRequestFile = null;

            //string value1 = testService.UploadFileAsync(filePathRequestFile, "asdasd").Result;
            //Assert.IsNotNull(value1);

            string value2 = testService.UploadFileAsync(new TestServiceUploadFileParam
            {
                Age  = 1,
                Name = "asd111",
                File = new FilePathRequestFile(@"E:\asdasdasd.txt")
                {
                    Name = "file"
                }
            }).Result;

            Assert.IsNotNull(value2);

            string value = testService.UploadFileAsync(filePathRequestFile, new TestServiceParam
            {
                Age  = 1,
                Name = "asdasd"
            }).Result;

            Assert.IsNotNull(value);

            value = testService.FormTestAsync(new TestServiceParam
            {
                Age  = 1,
                Name = "32424"
            }).Result;
            Assert.IsNotNull(value);

            value = testService.UploadFilesAsync(
                new FilePathRequestFile(@"E:\asdasdasd.txt"),
                new FilePathRequestFile(@"E:\asdasdasd.txt"),
                new FilePathRequestFile(@"E:\asdasdasd.txt")
                ).Result;
            Assert.IsNotNull(value);

            Assert.AreNotEqual(value, "");
            var result = testService.GetQueryResultValue("", null);
        }
Beispiel #2
0
        static void Test1()
        {
            IBaiduTestService testService = FeignClients.Get <IBaiduTestService>();

            Console.WriteLine(testService.GetType().FullName);
        }