Пример #1
0
        public void Test1()
        {
            var Instance = new TestService();

            RestServiceProvider.RestProvider provider = new RestServiceProvider.RestProvider();
            Assert.DoesNotThrow(() => provider.Start());
            Assert.DoesNotThrow(() => provider.RegisterApi(Instance));



            Assert.Pass();
        }
Пример #2
0
        static void Main(string[] args)
        {
            var Instance = new TestService();

            RestServiceProvider.RestProvider provider = new RestServiceProvider.RestProvider();
            provider.RegisterApi(Instance);
            provider.Start(5000);
            Console.WriteLine("Init Done. Try http://localhost:5000/GetTrade?TradeDate=2021-01-01");
            Console.WriteLine("Press Enter to exit");
            Console.ReadLine();
            provider.Stop();
        }