コード例 #1
0
        static void Main(string[] args)
        {
            string instruction = ServeMe.GetMethodExecutionInstruction(typeof(Program), nameof(GetSomething));
            string serverCsv   = $"equalto /search,assembly {instruction},get\napp log";

            using (var serveMe = new ServeMe())
            {
                string url = serveMe.Start(serverCsv).First();
                Process.Start(url);
                Console.ReadKey();
            }
        }
コード例 #2
0
        public void execute_a_function_in_assembly()
        {
            string methodName = nameof(this.DoSomething);
            string arg        = "w";

            string instruction = ServeMe.GetMethodExecutionInstruction(this.GetType(), methodName, arg);

            string serverCsv = @"getSome,assembly " + instruction + ",get";

            //getSome,assembly file:///D:/ServeMe.Tests/bin/Debug/ServeMe.Tests.DLL ServeMe.Tests.when_serve_me_runs DoSomething w,get
            using (var serveMe = new ServeMe())
            {
                string          url         = serveMe.Start(serverCsv).First();
                HttpWebResponse result      = (url + "/getSome").HttpGet();
                string          finalResult = result.ReadStringFromResponse().Trim().ToLower();
                Assert.IsTrue(finalResult == "yo " + arg);
                Assert.AreEqual(HttpStatusCode.OK, result.StatusCode);
            }
        }