コード例 #1
0
 public GetTestContextModule(GetTestContextHandler handler)
 {
     Post["/gettestcontext"] = x =>
         {
             var request = this.Bind<TestCommandRequest>();
             return Response.AsJson(handler.GetTestContextResponse(request));
         };
 }
コード例 #2
0
 public GetTestContextModule(GetTestContextHandler handler)
 {
     Post["/gettestcontext"] = x =>
     {
         var request = this.Bind <TestCommandRequest>();
         return(Response.AsJson(handler.GetTestContextResponse(request)));
     };
 }
コード例 #3
0
        public static GetContextResponse GetContextInformation(this string editorText)
        {
            var cursorPosition = TestHelpers.GetLineAndColumnFromDollar(editorText);
            editorText = editorText.Replace("$", "");

            var solution = new FakeSolution();
            var project = new FakeProject();
            project.AddFile(editorText);
            solution.Projects.Add(project);

            var handler = new GetTestContextHandler(solution, new BufferParser(solution));
            var request = new TestCommandRequest
            {
                Buffer = editorText,
                FileName = "myfile",
                Line = cursorPosition.Line,
                Column = cursorPosition.Column,
            };

            return handler.GetContextResponse(request);
        }